test: update test forkflow
parent
6b11e7c588
commit
97ea668294
|
@ -14,21 +14,25 @@ on:
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unity-test:
|
setup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
versions: ${{ steps.setup.outputs.versions }}
|
||||||
|
steps:
|
||||||
|
- id: setup
|
||||||
|
run: |
|
||||||
|
VERSIONS=`npx unity-changeset list --versions --all --latest-patch --min 2018.3 --json`
|
||||||
|
echo "==== Target Unity Versions ===="
|
||||||
|
echo "${VERSIONS}"
|
||||||
|
echo "::set-output name=versions::${VERSIONS}"
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: setup
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
unityVersion: [
|
version: ${{ fromJson(needs.setup.outputs.versions) }}
|
||||||
"2018.3.14f1",
|
|
||||||
"2018.4.30f1",
|
|
||||||
"2019.1.14f1",
|
|
||||||
"2019.2.21f1",
|
|
||||||
"2019.3.15f1",
|
|
||||||
"2019.4.16f1",
|
|
||||||
"2020.1.17f1",
|
|
||||||
"2020.2.1f1",
|
|
||||||
]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout sandbox project
|
# Checkout sandbox project
|
||||||
|
@ -43,52 +47,23 @@ jobs:
|
||||||
working-directory: Packages/dev
|
working-directory: Packages/dev
|
||||||
run: git checkout ${{ github.sha }}
|
run: git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
# Cache
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: Library
|
path: Library
|
||||||
key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
|
key: Library-${{ matrix.version }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
Library-${{ matrix.unityVersion }}-
|
Library-${{ matrix.version }}-
|
||||||
Library-
|
Library-
|
||||||
|
|
||||||
# Install codecoverage package
|
|
||||||
- name: "Install codecoverage package"
|
|
||||||
if: startsWith(matrix.unityVersion, '2019.4.')
|
|
||||||
run: |
|
|
||||||
npx openupm-cli add -f com.unity.testtools.codecoverage@0.4.0-preview
|
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
- name: "Run tests"
|
- name: "Run tests"
|
||||||
uses: game-ci/unity-test-runner@main
|
uses: game-ci/unity-test-runner@v2
|
||||||
with:
|
with:
|
||||||
unityVersion: ${{ matrix.unityVersion }}
|
customImage: mobsakai/unity3d:${{ matrix.version }}
|
||||||
customParameters: -nographics -enableCodeCoverage -coverageOptions assemblyFilters:+Coffee.UIParticle.*Tests
|
customParameters: -nographics
|
||||||
|
# unityVersion: ${{ matrix.version }}
|
||||||
|
checkName: ${{ matrix.version }} Test Results
|
||||||
|
githubToken: ${{ github.token }}
|
||||||
env:
|
env:
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: TestResults-${{ matrix.unityVersion }}
|
|
||||||
path: |
|
|
||||||
artifacts/*.xml
|
|
||||||
CodeCoverage/**/TestCoverageResults_*.xml
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: unity-test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: always()
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
path: artifacts
|
|
||||||
|
|
||||||
- uses: testspace-com/setup-testspace@v1
|
|
||||||
with:
|
|
||||||
domain: ${{github.repository_owner}}
|
|
||||||
|
|
||||||
- name: Push test results
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
testspace `find . -name '*.xml' | tr '\n' ' '`
|
|
Loading…
Reference in New Issue