-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add running tests on unity2019 branch
- Loading branch information
1 parent
8120d07
commit 67f3ee4
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Copyright (c) 2021-2023 Koji Hasegawa. | ||
# This software is released under the MIT License. | ||
|
||
name: Test running on unity2019 branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- unity2019 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
checks: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
unityVersion: # Available versions see: https://game.ci/docs/docker/versions | ||
- 2019.4.40f1 | ||
- 2020.3.48f1 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
lfs: false | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: Library | ||
key: Library-${{ matrix.unityVersion }} | ||
restore-keys: | | ||
Library- | ||
- name: Set coverage assembly filters | ||
run: | | ||
assemblies=$(find ./Packages -name "*.asmdef" | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//) | ||
assemblies+=("+LocalPackageSample*") | ||
# shellcheck disable=SC2001,SC2048,SC2086 | ||
echo "assembly_filters=+<assets>,$(echo ${assemblies[*]} | sed -e s/\ /,/g),-*.Tests" >> "$GITHUB_ENV" | ||
- 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@v3 | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
unityVersion: ${{ matrix.unityVersion }} # Default is `auto` | ||
checkName: test result (${{ matrix.unityVersion }}) | ||
customParameters: -testCategory "!IgnoreCI;!Integration" | ||
coverageOptions: generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }} | ||
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html | ||
env: | ||
UNITY_LICENSE: ${{ secrets[env.secret_key] }} | ||
id: test | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: TestResults-Unity${{ matrix.unityVersion }} | ||
path: | | ||
${{ steps.test.outputs.artifactsPath }} | ||
${{ steps.test.outputs.coveragePath }} | ||
if: always() | ||
|
||
notify: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
if: always() | ||
|
||
steps: | ||
- uses: Gamesight/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} |