diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6a18ca..455582d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,21 +14,25 @@ on: - synchronize jobs: - unity-test: + setup: 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: fail-fast: false matrix: - unityVersion: [ - "2018.3.14f1", - "2018.4.30f1", - "2019.1.14f1", - "2019.2.21f1", - "2019.3.15f1", - "2019.4.16f1", - "2020.1.17f1", - "2020.2.1f1", - ] + version: ${{ fromJson(needs.setup.outputs.versions) }} steps: # Checkout sandbox project @@ -43,52 +47,23 @@ jobs: working-directory: Packages/dev run: git checkout ${{ github.sha }} + # Cache - uses: actions/cache@v2 with: path: Library - key: Library-${{ matrix.unityVersion }}-${{ github.sha }} + key: Library-${{ matrix.version }}-${{ github.sha }} restore-keys: | - Library-${{ matrix.unityVersion }}- + Library-${{ matrix.version }}- 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 - name: "Run tests" - uses: game-ci/unity-test-runner@main + uses: game-ci/unity-test-runner@v2 with: - unityVersion: ${{ matrix.unityVersion }} - customParameters: -nographics -enableCodeCoverage -coverageOptions assemblyFilters:+Coffee.UIParticle.*Tests + customImage: mobsakai/unity3d:${{ matrix.version }} + customParameters: -nographics + # unityVersion: ${{ matrix.version }} + checkName: ${{ matrix.version }} Test Results + githubToken: ${{ github.token }} env: 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' ' '` \ No newline at end of file