Add Unit Tests (#4)

This commit is contained in:
Lamont Huffman
2025-10-31 11:04:34 +08:00
committed by GitHub
parent 158a5e63b1
commit ef5c7d9aab
38 changed files with 1249 additions and 1122 deletions

38
.github/workflows/test_game.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Run test_game.py
on:
schedule:
- cron: '0 0 */3 * *'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Debug directory structure
run: |
# ✅ Show actual directory structure
echo "Current directory: $(pwd)"
ls -la
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10
- name: Install dependencies
run: |
cd games/game_werewolves
pip install pytest pytest-asyncio
pip install -r requirements.txt
- name: Run game_test.py
env:
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
PYTHONPATH: ${{ env.GITHUB_WORKSPACE }}/games/game_werewolves
run: |
# ✅ Ensure correct working directory
python -m pytest tests/game_test.py -v