Skip to content

Commit

Permalink
Fix test workflows
Browse files Browse the repository at this point in the history
- Add email and password to unity-test-runner
- Upgrade Unity versions running on workflows

(cherry picked from commit 3385efb)
  • Loading branch information
nowsprinting committed Dec 15, 2023
1 parent ef028b7 commit 6d6f6d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ concurrency:

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 }}
permissions:
contents: read
Expand All @@ -32,9 +33,9 @@ jobs:
fail-fast: false
matrix:
unityVersion: # Available versions see: https://game.ci/docs/docker/versions
- 2021.3.31f1
- 2022.3.12f1
- 2023.1.18f1
- 2021.3.33f1
- 2022.3.15f1
- 2023.2.3f1

steps:
- name: Checkout repository
Expand All @@ -61,7 +62,7 @@ jobs:
run: echo "secret_key=UNITY_LICENSE_$(echo ${{ matrix.unityVersion }} | cut -c 1-4)" >> "$GITHUB_ENV"

- name: Run tests
uses: game-ci/unity-test-runner@v3
uses: game-ci/unity-test-runner@v4
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: ${{ matrix.unityVersion }} # Default is `auto`
Expand All @@ -71,6 +72,8 @@ jobs:
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html
env:
UNITY_LICENSE: ${{ secrets[env.secret_key] }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
id: test

- name: Upload test results
Expand All @@ -84,10 +87,10 @@ jobs:

notify:
needs: test
if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
runs-on: ubuntu-latest
permissions:
actions: read
if: always()

steps:
- uses: Gamesight/[email protected]
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ concurrency:

jobs:
test:
if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -33,11 +34,11 @@ jobs:
fail-fast: false
matrix:
unityVersion: # Available versions see: https://game.ci/docs/docker/versions
- 2021.3.31f1
- 2022.3.12f1
- 2023.1.18f1
- 2021.3.33f1
- 2022.3.15f1
- 2023.2.3f1
include:
- unityVersion: 2021.3.31f1
- unityVersion: 2021.3.33f1
octocov: true

steps:
Expand Down Expand Up @@ -65,7 +66,7 @@ jobs:
run: echo "secret_key=UNITY_LICENSE_$(echo ${{ matrix.unityVersion }} | cut -c 1-4)" >> "$GITHUB_ENV"

- name: Run tests
uses: game-ci/unity-test-runner@v3
uses: game-ci/unity-test-runner@v4
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: ${{ matrix.unityVersion }} # Default is `auto`
Expand All @@ -75,6 +76,8 @@ jobs:
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html
env:
UNITY_LICENSE: ${{ secrets[env.secret_key] }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
id: test

- name: Set coverage path for octocov
Expand All @@ -96,10 +99,10 @@ jobs:

notify:
needs: test
if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
runs-on: ubuntu-latest
permissions:
actions: read
if: always()

steps:
- uses: Gamesight/[email protected]
Expand Down

0 comments on commit 6d6f6d1

Please sign in to comment.