Skip to content

Commit

Permalink
Don't hardcode git repo in test actions
Browse files Browse the repository at this point in the history
Now saving tests will be run if the GAME_TEST_FILES_TOKEN secret is set on the repo, or skipped if it is blank.
  • Loading branch information
LagoLunatic committed Jun 28, 2024
1 parent e5d7e57 commit b8c1866
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
runs-on: ${{ matrix.os }}

env:
game_test_files_token: ${{ secrets.GAME_TEST_FILES_TOKEN }}
DISPLAY: ':99.0'

defaults:
Expand All @@ -48,14 +49,14 @@ jobs:
with:
submodules: recursive
- name: Checkout game-test-files
if: github.repository == 'LagoLunatic/wwrando'
if: ${{ env.game_test_files_token != '' }}
uses: actions/checkout@v4
with:
repository: LagoLunatic/game-test-files
path: game-test-files
token: ${{ secrets.GAME_TEST_FILES_TOKEN }}
token: ${{ env.game_test_files_token }}
- name: Extract test files
if: github.repository == 'LagoLunatic/wwrando'
if: ${{ env.game_test_files_token != '' }}
run: |
7z x $PWD/game-test-files/files/GZLE01.7z -o$PWD/game-test-files/files
- name: Set up Python
Expand Down Expand Up @@ -99,12 +100,12 @@ jobs:
echo WW_GZLE01_STRIPPED_PATH=$PWD/game-test-files/files/GZLE01.iso >> .env
echo WW_RANDO_OUTPUT_DIR=$PWD/wwrando-output >> .env
- name: Test with pytest (with saving)
if: github.repository == 'LagoLunatic/wwrando'
if: ${{ env.game_test_files_token != '' }}
run: |
pip install pytest pytest-cov
pytest test --cov --cov-report=html
- name: Test with pytest (without saving)
if: github.repository != 'LagoLunatic/wwrando'
if: ${{ env.game_test_files_token == '' }}
run: |
pip install pytest pytest-cov
pytest test --cov --cov-report=html -m "not saving"
Expand Down

0 comments on commit b8c1866

Please sign in to comment.