Make OpenAL good #589
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| butterscotch-linux-x86_64: | |
| name: Butterscotch Tests (GLFW/Linux x86_64) | |
| runs-on: ubuntu-latest | |
| env: | |
| DOWNLOAD_COMMERCIAL_GAMES: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get commit info | |
| id: commit-info | |
| run: | | |
| echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "date=$(git log -1 --format=%cd --date=short)" >> $GITHUB_OUTPUT | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y cmake libglfw3-dev libbz2-dev | |
| - name: Configure | |
| run: cmake -B build -DDESKTOP_BACKEND=glfw3 -DCMAKE_BUILD_TYPE=Release "-DBUTTERSCOTCH_COMMIT_HASH=${{ steps.commit-info.outputs.hash }}" "-DBUTTERSCOTCH_COMMIT_DATE=${{ steps.commit-info.outputs.date }}" | |
| - name: Build Butterscotch | |
| run: cmake --build build -j$(nproc) | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Install Xvfb | |
| run: sudo apt-get install -y xvfb | |
| - name: Download Commercial Games | |
| if: env.DOWNLOAD_COMMERCIAL_GAMES == 'true' | |
| env: | |
| COMMERCIAL_GAMES_URL: ${{ secrets.COMMERCIAL_GAMES_URL }} | |
| run: | | |
| games=( | |
| undertale-ptbr-winpack | |
| underfavela | |
| deltarune-chapter4-105-beta | |
| ) | |
| for game in "${games[@]}"; do | |
| echo "Downloading $game..." | |
| curl --fail --silent --show-error --location --output "tests/$game.zip" "$COMMERCIAL_GAMES_URL/$game.zip" | |
| unzip -q "tests/$game.zip" -d "tests/$game" | |
| done | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run Butterscotch test suite | |
| working-directory: tests/Flowey | |
| run: | | |
| xvfb-run -a ./gradlew --no-daemon run --args="--test-suite ${{ github.workspace }}/tests/tests.conf --butterscotch-path ${{ github.workspace }}/build/butterscotch --skip-commercial-games=${{ env.DOWNLOAD_COMMERCIAL_GAMES != 'true' }}" | |
| - name: Upload test screenshots | |
| if: always() # the test step exits 1 on failure; run regardless | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-screenshots | |
| path: | | |
| tests/**/actual.*.png | |
| if-no-files-found: ignore |