Skip to content

Commit

Permalink
Add CI test for running full randomizer executable
Browse files Browse the repository at this point in the history
  • Loading branch information
mike8699 committed Sep 26, 2023
1 parent 23c4008 commit c13b7ac
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,58 @@ jobs:
name: ph-randomizer_${{ steps.commit-hash.outputs.hash }}_${{ matrix.os }}
path: dist/

run-executable:
name: Run built randomizer executable [${{ matrix.rom_variant }}]
needs: [build]
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
include:
- rom_variant: US
google_drive_url_secret: PH_US_GOOGLE_DRIVE_ID
- rom_variant: US (D-Pad Patch)
google_drive_url_secret: PH_US_DPAD_GOOGLE_DRIVE_ID
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
check-latest: true

- name: Upgrade `pip` and install `wheel`
run: python -m pip install --upgrade pip wheel

- name: Fetch PH rom
run: |
pip install gdown
gdown ${{ secrets[matrix.google_drive_url_secret] }}
- name: Get filename of rom
id: rom-filename
run: echo "rom_filename=$(ls *.nds)" >> $GITHUB_OUTPUT

- name: Get current commit hash
id: commit-hash
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Download built executable from previous job
uses: actions/download-artifact@v3
with:
name: ph-randomizer_${{ steps.commit-hash.outputs.hash }}_${{ matrix.os }}

- name: Run executable (no GUI)
run: ph-randomizer_${{ steps.commit-hash.outputs.hash }}_${{ matrix.os }}/ph_rando --no-gui --input-rom-path="${{ steps.rom-filename.outputs.rom_filename }}" --output-rom-path="out.nds"

- name: Cleanup
run: rm -rf *.nds

release:
name: Publish a release
# Require all tests to pass before a release is possible
Expand All @@ -523,6 +575,7 @@ jobs:
- check-aux-data
- run-shuffler
- test-desmume
- run-executable
# Only create a release if a tag was pushed
if: "startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
Expand Down

0 comments on commit c13b7ac

Please sign in to comment.