Add Unit Tests (#4)
This commit is contained in:
38
.github/workflows/test_game.yml
vendored
Normal file
38
.github/workflows/test_game.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user