Added GitHub workflows (#81)
This commit is contained in:
1 parent
24c7a2ca7d
commit
b9478d5e2f
5 files changed
+116
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
tests/test.sh
|
||||||
|
build:
|
||||||
|
needs: [test]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v1.1.0
|
||||||
|
with:
|
||||||
|
repository: itzg/minecraft-bedrock-server
|
||||||
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
tag_with_ref: true
|
||||||
|
tag_with_sha: false
|
||||||
|
cache_froms: itzg/minecraft-bedrock-server:latest
|
||||||
|
add_git_labels: true
|
||||||
|
push: false
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
name: Validate PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
tests/test.sh
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
sut:
|
||||||
|
depends_on:
|
||||||
|
- mc
|
||||||
|
image: itzg/mc-monitor:0.6.0
|
||||||
|
command: status-bedrock --host mc --retry-interval 1s --retry-limit 60
|
||||||
|
mc:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
sut:
|
||||||
|
depends_on:
|
||||||
|
- mc
|
||||||
|
image: itzg/mc-monitor:0.6.0
|
||||||
|
command: status-bedrock --host mc --retry-interval 1s --retry-limit 90
|
||||||
|
mc:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
VERSION: "${BDS_VERSION}"
|
||||||
|
volumes:
|
||||||
|
- mc:/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mc:
|
||||||
|
external:
|
||||||
|
name: mc-shared
|
||||||
Executable
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Args:
|
||||||
|
# - compose project
|
||||||
|
# - test description
|
||||||
|
runTest() {
|
||||||
|
composeArgs="-f docker-compose.$1.test.yml -p $1"
|
||||||
|
failed=false
|
||||||
|
docker-compose ${composeArgs} run sut || failed=true
|
||||||
|
$failed && docker-compose ${composeArgs} logs
|
||||||
|
docker-compose ${composeArgs} down -v
|
||||||
|
if $failed; then
|
||||||
|
echo "Test failed using compose project $1: $2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cd $(dirname $0)
|
||||||
|
|
||||||
|
runTest defaults "using defaults"
|
||||||
|
|
||||||
|
docker volume create mc-shared
|
||||||
|
trap "docker volume rm mc-shared" EXIT
|
||||||
|
|
||||||
|
export BDS_VERSION=1.14
|
||||||
|
runTest versioned "with VERSION=1.14"
|
||||||
|
export BDS_VERSION=1.16
|
||||||
|
runTest versioned "upgrading to VERSION=1.16"
|
||||||
Reference in new issue
Block a user