Integration Test runs on ubuntu-latest #7
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
| # Copyright (c) 2021-2026 Koji Hasegawa. | |
| # This software is released under the MIT License. | |
| name: Integration Test | |
| run-name: ${{ github.workflow }} runs on ${{ github.event.inputs.runner }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| runner: | |
| type: choice | |
| description: Runner | |
| options: # see: https://www.ubicloud.com/docs/about/pricing | |
| - ubuntu-latest | |
| - ubicloud-standard-2-ubuntu-2204 | |
| - ubicloud-standard-4-ubuntu-2204 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.runner }} | |
| cancel-in-progress: true | |
| permissions: { } | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test: | |
| if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets. | |
| runs-on: ${{ github.event.inputs.runner }} | |
| timeout-minutes: 20 | |
| permissions: | |
| contents: read | |
| checks: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unityVersion: # Available versions see: https://game.ci/docs/docker/versions | |
| - 6000.0.43f1 # Latest version that does not pin the test framework package. | |
| testMode: | |
| - PlayMode # run tests in editor | |
| - Standalone # run tests on player | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| submodules: false | |
| lfs: false | |
| - name: Restore cache | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 | |
| with: | |
| path: Library | |
| key: Library-${{ runner.os }}-${{ matrix.unityVersion }}-${{ hashFiles('Packages/packages-lock.json') }} | |
| restore-keys: | | |
| Library-${{ runner.os }}-${{ matrix.unityVersion }}- | |
| Library-${{ runner.os }}- | |
| Library- | |
| - name: Set license secret key | |
| run: echo "secret_key=UNITY_LICENSE_$(echo ${{ matrix.unityVersion }} | cut -c 1-4)" >> "$GITHUB_ENV" | |
| - name: Run tests | |
| uses: game-ci/unity-test-runner@0ff419b913a3630032cbe0de48a0099b5a9f0ed9 # v4 | |
| with: | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| unityVersion: ${{ matrix.unityVersion }} # Default is `auto` | |
| checkName: test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }}) | |
| customParameters: -testCategory "Integration;!IgnoreCI" -testHelperScreenshotDirectory /github/workspace/artifacts/Screenshots | |
| # Note: `/github/workspace/artifacts` is the artifacts path inside the game-ci container | |
| testMode: ${{ matrix.testMode }} | |
| env: | |
| UNITY_LICENSE: ${{ secrets[env.secret_key] }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| id: test | |
| - name: Upload test results | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: TestResults-Unity${{ matrix.unityVersion }}-${{ matrix.testMode }} | |
| path: | | |
| ${{ steps.test.outputs.artifactsPath }} | |
| if: always() |