Skip to content

implemented new config options #5

implemented new config options

implemented new config options #5

Workflow file for this run

---
name: unit-test-component-run-on-pr
on:
pull_request: # Run tests on all pull requests
concurrency:
group: "${{ github.workflow }} @ ${{ github.ref }}"
cancel-in-progress: true
jobs:
unit-test-amd64:
name: Docker - Test Linux-amd64 image
runs-on: ubuntu-latest
steps:
- name: Get Runner Info
run: |
id
pwd
git --version
docker version
echo "TIMEOUT_SECONDS: ${{ vars.TIMEOUT_SECONDS }}"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
file: ./Dockerfile
load: true
tags: ${{ github.run_id }}
platforms: linux/amd64
- name: Run server
run: |
docker run -d \
--name palworld-dedicated-server \
-p 8211:8211/udp \
-p 8212:8212/tcp \
-p 25575:25575/tcp \
-e ADMIN_PASSWORD=123 \
-e SERVER_PASSWORD=456 \
-e SERVER_SETTINGS_MODE=auto \
-v ./game:/palworld/ \
--restart unless-stopped \
--stop-timeout 30 \
${{ github.run_id }}
- name: Wait for server to start
run: |
START_TIME=$(date +%s)
echo "TIMEOUT_SECONDS: ${{ vars.TIMEOUT_SECONDS }}"
# Set the timezone to Germany (Central European Time)
export TZ=Europe/Berlin
while ! docker logs palworld-dedicated-server 2>&1 | grep -q "Setting breakpad minidump AppID"; do
CURRENT_TIME=$(date +%s)
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
if [ $ELAPSED_TIME -gt ${{ vars.TIMEOUT_SECONDS }} ]; then
echo "Timeout reached. Server failed to start within ${{ vars.TIMEOUT_SECONDS }} seconds."
printf "\e[0;32m%s\e[0m\n" "*****Container LOGS*****"
docker logs palworld-dedicated-server
exit 1
fi
echo "$(date '+%H:%M:%S') - Waiting for server to start..."
sleep 5
done
echo "Server successfully started"
printf "\e[0;32m%s\e[0m\n" "*****Container LOGS*****"
docker logs palworld-dedicated-server
- name: Test if port 8766, 27015 and 27016 are listening
run: |
nc -z -u -v 127.0.0.1 8211 || exit 2
nc -z -v 127.0.0.1 8212 || exit 3
nc -z -v 127.0.0.1 25575 || exit 4
- name: Stop server
if: always()
run: |
docker stop palworld-dedicated-server
docker rm palworld-dedicated-server
docker rmi ${{ github.run_id }}