From 54ce93588c59ab65d85b81a238485ca0705bcec4 Mon Sep 17 00:00:00 2001 From: Blocka Wan Date: Tue, 13 Feb 2024 03:55:58 +0800 Subject: [PATCH 1/2] change docker env to env-file --- .github/workflows/unit-test.yml | 44 +++++++++------------------------ 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 7338c3824..20c2df0bb 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,9 +1,13 @@ --- name: Unit-test -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy pull_request: workflow_call: +concurrency: + group: '${{ github.workflow }} @ ${{ github.ref }}' + cancel-in-progress: true + jobs: unit-test-amd64: name: Docker - Test (amd64) @@ -30,19 +34,7 @@ jobs: -p 27015:27015/udp \ -p 25575:25575/tcp \ -v ./palworld:/palworld/ \ - -e PUID=1000 \ - -e PGID=1000 \ - -e PORT=8211 \ - -e PLAYERS=16 \ - -e MULTITHREADING=true \ - -e RCON_ENABLED=true \ - -e RCON_PORT=25575 \ - -e TZ=UTC \ - -e ADMIN_PASSWORD="adminPasswordHere" \ - -e SERVER_PASSWORD="worldofpals" \ - -e COMMUNITY=false \ - -e SERVER_NAME="World of Pals" \ - -e SERVER_DESCRIPTION="palworld-server-docker by Thijs van Loef" \ + --env-file .env.example \ --restart unless-stopped \ --stop-timeout 30 \ ${{ github.run_id }} @@ -79,7 +71,7 @@ jobs: nc -z -u -v 127.0.0.1 27015 || exit 1 nc -z -v 127.0.0.1 25575 || exit 1 - - name: Test the backup command functions + - name: Test the backup script run: | docker exec palworld-server backup if [ ! -f ./palworld/backups/palworld-save-*.tar.gz ]; then @@ -117,7 +109,7 @@ jobs: with: file: ./Dockerfile load: true - tags: ${{ github.run_id }} + tags: ${{ github.run_id }}:arm64 platforms: linux/arm64 - name: Run server @@ -129,26 +121,14 @@ jobs: -p 27015:27015/udp \ -p 25575:25575/tcp \ -v ./palworld:/palworld/ \ - -e PUID=1000 \ - -e PGID=1000 \ - -e PORT=8211 \ - -e PLAYERS=16 \ - -e MULTITHREADING=true \ - -e RCON_ENABLED=true \ - -e RCON_PORT=25575 \ - -e TZ=UTC \ - -e ADMIN_PASSWORD="adminPasswordHere" \ - -e SERVER_PASSWORD="worldofpals" \ - -e COMMUNITY=false \ - -e SERVER_NAME="World of Pals" \ - -e SERVER_DESCRIPTION="palworld-server-docker by Thijs van Loef" \ + --env-file .env.example \ --restart unless-stopped \ --stop-timeout 30 \ - ${{ github.run_id }} + ${{ github.run_id }}:arm64 - name: Wait for server to start run: | - TIMEOUT_SECONDS=400 + TIMEOUT_SECONDS=600 START_TIME=$(date +%s) while ! docker logs palworld-server 2>&1 | grep -q "Setting breakpad minidump AppID"; do @@ -178,7 +158,7 @@ jobs: nc -z -u -v 127.0.0.1 27015 || exit 1 nc -z -v 127.0.0.1 25575 || exit 1 - - name: Test the backup command functions + - name: Test the backup script run: | docker exec palworld-server backup if [ ! -f ./palworld/backups/palworld-save-*.tar.gz ]; then From d14019b300fa59db15b494c366033469a9b6fc37 Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Wed, 14 Feb 2024 10:18:15 +0100 Subject: [PATCH 2/2] fix linting --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 20c2df0bb..caa1f47f6 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,6 +1,6 @@ --- name: Unit-test -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy pull_request: workflow_call: