Skip to content

Commit

Permalink
test: validate unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Oct 3, 2024
1 parent e14065c commit 0928132
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,45 @@ jobs:
with:
context: ./container
build-args: GAME=cstrike
load: true

- name: Get Docker Image ID
id: get_image_id
run: echo "::set-output name=image_id::$(docker images -q | head -n 1)"

- name: Add Custom Mod Content 📂
run: |
mkdir -p ./mods
mkdir -p ./mods/decay
touch ./mods/decay/plugin.ini
- name: Add Configuration 📂
run: |
mkdir -p ./config
touch ./config/test.cfg
- name: Run Docker Container 🐳
run: |
docker run -d --name test-container ${{ steps.get_image_id.outputs.image_id }}
- name: Validate Directory Mappings 📂
run: |
# Check if plugin.ini exists in the decay directory
if [ "$(docker exec test-container ls /opt/steam/hlds/decay | grep -c 'plugin.ini')" -eq 0 ]; then
echo "plugin.ini file is missing in the decay directory!"
exit 1
fi
# Check if test.cfg exists in the cstrike directory
if [ "$(docker exec test-container ls /opt/steam/hlds/cstrike | grep -c 'test.cfg')" -eq 0 ]; then
echo "test.cfg file is missing in the cstrike directory!"
exit 1
fi
echo "Volume mappings work as expectected!"
- name: Cleanup 🧹
if: always()
run: |
docker stop test-container
docker rm test-container

0 comments on commit 0928132

Please sign in to comment.