Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #35

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #35

Workflow file for this run

#
# ARK: Survival Evolved Dedicated Server using SteamCMD Docker Image.
# Copyright (C) 2022-2022 Renegade-Master [renegade.master.dev@protonmail.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
name: Build and Test Server Image
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
defaults:
run:
shell: bash
jobs:
build-and-run:
name: Build and Run Server
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v5
with:
root-reserve-mb: 1024
temp-reserve-mb: 1024
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Variables
id: variables
run: |
echo "::set-output name=datetime::$(date +%Y%m%dT%H%M%SZ)"
echo "::set-output name=userid::$(id -u)"
echo "::set-output name=groupid::$(id -g)"
- name: Set Permissions on Executable Scripts
run: |
chmod +x src/install_server.scmd
chmod +x src/run_server.sh
- name: Make Directories
run: mkdir -p ArkSE_Install/ShooterGame/Saved ArkSE_Config
- name: Build the Docker Image
if: ${{ success() }}
run: |
docker build \
--file docker/ark-se-dedicated-server.Dockerfile \
--tag renegademaster/ark-se-dedicated-server:${{ steps.variables.outputs.datetime }} \
--build-arg USER_ID=${{ steps.variables.outputs.userid }} \
--build-arg GROUP_ID=${{ steps.variables.outputs.groupid }} \
.
- name: Test Run the Docker Image
if: ${{ success() }}
continue-on-error: true
timeout-minutes: 20
run: |
docker run \
--rm \
--name ark-se-server \
--user ${{ steps.variables.outputs.userid }}:${{ steps.variables.outputs.groupid }} \
--mount type=bind,source="$(pwd)/ArkSE_Install",target=/home/steam/ArkSE_Install \
--mount type=bind,source="$(pwd)/ArkSE_Config",target=/home/steam/ArkSE_Install/ShooterGame/Saved \
--ulimit nofile=1000000:1000000 \
--env=GAME_PORT="25496" \
--env=MAP_NAME="TheCenter" \
--env=MAX_PLAYERS="14" \
--env=SERVER_NAME="GitHubActionTest" \
--env=ADMIN_PASSWORD="github_action_test_admin_password" \
--env=SERVER_PASSWORD="github_action_test_password" \
renegademaster/ark-se-dedicated-server:${{ steps.variables.outputs.datetime }} \
2>&1 | tee ./docker-log.log
- name: Investigate File Structure and Diskspace on Failure
if: ${{ failure() }}
run: |
pwd
echo ''
ls -lAuhFn ./ArkSE_Install/
echo ''
ls -lAuhFn ./ArkSE_Config/
echo ''
tree -aL 4 ./ArkSE_Install/
echo ''
tree -aL 4 ./ArkSE_Config/
echo ''
echo "Memory and swap:"
free
echo ''
swapon --show
echo ''
echo "Available storage:"
df -h
- name: Upload Docker Logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: docker-logs
path: |
docker-log.log
- name: Upload Server Configuration
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: server-configs
path: |
ArkSE_Config/Config/LinuxServer/GameUserSettings.ini
ArkSE_Config/Config/LinuxServer/Game.ini
test:
name: Test Server
runs-on: ubuntu-latest
needs:
- build-and-run
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download Docker Logs
uses: actions/download-artifact@v4.1.7
with:
name: docker-logs
- name: Download Server Configs
uses: actions/download-artifact@v4.1.7
with:
name: server-configs
- name: Test - Server Downloaded
run: |
check_for_config() {
if ! grep -q -iE "$1" "./docker-log.log"; then
printf "Could not find %s in %s\n" "$1" "./docker-log.log"
exit 1
else
printf "Found %s in %s\n" "$1" "./docker-log.log"
fi
}
check_for_config "Success! App '376030' fully installed."
- name: Test - Server Started
run: |
check_for_config() {
if ! grep -q -iE "$1" "./docker-log.log"; then
printf "Could not find %s in %s\n" "$1" "./docker-log.log"
exit 1
else
printf "Found %s in %s\n" "$1" "./docker-log.log"
fi
}
check_for_config "Setting breakpad minidump AppID = 346110"
- name: Test - Server Configuration Applied
run: |
test_failed=0
# Check for Max Players
expected="14"
actual="$("./src/edit_server_config.py" "./GameUserSettings.ini" "/Script/Engine.GameSession" "MaxPlayers")"
if [[ "$actual" == "$expected" ]]; then
printf "MaxPlayers is %s\n" "$actual"
else
printf "E: Test failed. Expected: [%s] Actual: [%s]" "$expected" "$actual"
test_failed=1
fi
# Check for Server Admin Password
expected="github_action_test_admin_password"
actual="$("./src/edit_server_config.py" "./GameUserSettings.ini" "ServerSettings" "ServerAdminPassword")"
if [[ "$actual" == "$expected" ]]; then
printf "ServerAdminPassword is [%s]\n" "$actual"
else
printf "E: Test failed. Expected: [%s] Actual: [%s]" "$expected" "$actual"
test_failed=1
fi
# Check for Server Password
expected="github_action_test_password"
actual="$("./src/edit_server_config.py" "./GameUserSettings.ini" "ServerSettings" "ServerPassword")"
if [[ "$actual" == "$expected" ]]; then
printf "ServerPassword is [%s]\n" "$actual"
else
printf "E: Test failed. Expected: [%s] Actual: [%s]" "$expected" "$actual"
test_failed=1
fi
# Check for Server Name
expected="GitHubActionTest"
actual="$("./src/edit_server_config.py" "./GameUserSettings.ini" "SessionSettings" "SessionName")"
if [[ "$actual" == "$expected" ]]; then
printf "SessionName is [%s]\n" "$actual"
else
printf "E: Test failed. Expected: [%s] Actual: [%s]" "$expected" "$actual"
test_failed=1
fi
if [[ "$test_failed" == "1" ]]; then
exit 1
fi