From e40cb5d4194d84bfa17c2bcff06cc13101caf36c Mon Sep 17 00:00:00 2001 From: bd_ Date: Fri, 6 Oct 2023 19:39:51 +0900 Subject: [PATCH] ci: try to test on standalone configuration --- .github/workflows/gameci.yml | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gameci.yml b/.github/workflows/gameci.yml index dc015de..54a4a3a 100644 --- a/.github/workflows/gameci.yml +++ b/.github/workflows/gameci.yml @@ -46,10 +46,12 @@ jobs: matrix: #unity_version: [ auto, 2022.3.5f1 ] unity_version: [ auto ] + sdk: [ vrcsdk, standalone ] runs-on: ubuntu-latest permissions: checks: write contents: read + if: ${{ matrix.unity_version == 'auto' || matrix.sdk != 'vrcsdk' }} steps: - uses: actions/checkout@v3 with: @@ -62,6 +64,7 @@ jobs: mv 'Packages/nadena.dev.ndmf/UnitTests~' 'Packages/nadena.dev.ndmf/UnitTests' - uses: anatawa12/sh-actions/resolve-vpm-packages@master + if: ${{ matrix.sdk == 'vrcsdk' }} - run: | ls -lR @@ -71,12 +74,12 @@ jobs: - uses: actions/cache@v3 with: path: Library - key: Library-${{ matrix.unity_version }} + key: Library-${{ matrix.unity_version }}-${{ matrix.sdk }} restore-keys: Library- - uses: game-ci/unity-test-runner@v3 id: gameci - continue-on-error: ${{ matrix.unity_version != 'auto' }} + continue-on-error: true env: # meh, just a personal license... UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} @@ -87,6 +90,29 @@ jobs: coverageOptions: generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+nadena.dev.* customParameters: -nographics -assemblyNames nadena.dev.ndmf.UnitTests + # For our main "supported" platforms, we report the conclusion of gameci as-is. However, for standalone, we report + # neutral if it failed. + - id: determine_conclusion + env: + unity_version: ${{ matrix.unity_version }} + sdk_platform: ${{ matrix.sdk }} + gameci_outcome: ${{ steps.gameci.outcome }} + run: | + outcome=$gameci_conclusion + if [ "$gameci_conclusion" == "failure" ]; then + if [ "$unity_version" != auto ] || [ $sdk_platform != vrcsdk ]; then + outcome=neutral + fi + fi + echo ::set-output name=matrix_outcome::$outcome + + - uses: LouisBrunner/checks-action@v1.6.1 + if: ${{ github.event_name == 'pull_request_target' }} + with: + github_token: ${{ github.token }} + name: "GameCI: Unity ${{ matrix.unity_version }} / platform ${{ matrix.sdk }}" + conclusion: ${{ steps.determine_conclusion.outputs.matrix_outcome }} + - uses: actions/upload-artifact@v3 if: always() with: @@ -97,4 +123,8 @@ jobs: if: always() with: name: Coverage results - path: ${{ steps.gameci.outputs.coveragePath }} \ No newline at end of file + path: ${{ steps.gameci.outputs.coveragePath }} + + - id: fail-on-failure + if: ${{ steps.determine_conclusion.outputs.matrix_outcome == 'failure' }} + run: exit 1 \ No newline at end of file