mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
ci: Added testing step to github actions
This commit is contained in:
parent
5e75410e7c
commit
367c6cfd92
11
.github/workflows/main.yml
vendored
11
.github/workflows/main.yml
vendored
@ -16,7 +16,18 @@ on:
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
|
||||
|
||||
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:
|
||||
|
11
.github/workflows/pr.yml
vendored
11
.github/workflows/pr.yml
vendored
@ -5,15 +5,12 @@ on:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v1.1.0
|
||||
with:
|
||||
tag_with_sha: true
|
||||
cache_froms: itzg/minecraft-server:latest
|
||||
push: false
|
||||
- name: Run tests
|
||||
run: |
|
||||
tests/test.sh
|
||||
|
16
tests/docker-compose.test.yml
Normal file
16
tests/docker-compose.test.yml
Normal file
@ -0,0 +1,16 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
sut:
|
||||
depends_on:
|
||||
- mc
|
||||
image: itzg/mc-monitor:0.6.0
|
||||
command: status --host mc --retry-interval 1s --retry-limit 120
|
||||
mc:
|
||||
build:
|
||||
context: ..
|
||||
cache_from:
|
||||
- itzg/minecraft-server:latest
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
|
13
tests/test.sh
Executable file
13
tests/test.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
failed=false
|
||||
args="-f docker-compose.test.yml"
|
||||
docker-compose $args run sut || failed=true; docker-compose $args logs mc
|
||||
docker-compose $args down -v
|
||||
|
||||
if $failed; then
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user