diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b98a81c3a..9d563f4189 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: exit $exit_code - name: InspectCode - uses: JetBrains/ReSharper-InspectCode@v0.11 + uses: JetBrains/ReSharper-InspectCode@v0.12 with: # this is WTF tier but if you don't specify *both* of these the defaults assume `build: true` build: false @@ -101,14 +101,42 @@ jobs: NUnit.ConsoleOut=0 # Attempt to upload results even if test fails. - # https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#always + # https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#cancelled - name: Upload Test Results uses: actions/upload-artifact@v7 - if: ${{ always() }} + if: ${{ !cancelled() }} with: name: osu-test-results-${{matrix.os.prettyname}}-${{matrix.threadingMode}} path: ${{github.workspace}}/TestResults/TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx + test-results: + name: Test results + runs-on: ubuntu-latest + # we want to wait for the `test` job to complete, but run regardless of whether it succeeds or fails + # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-not-requiring-successful-dependent-jobs + if: ${{ !cancelled() }} + needs: test + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Download results + uses: actions/download-artifact@v8 + with: + pattern: osu-test-results-* + merge-multiple: true + + - name: Add test results summary to workflow run + uses: dorny/test-reporter@v3.0.0 + with: + name: Results + path: "*.trx" + reporter: dotnet-trx + list-suites: 'failed' + list-tests: 'failed' + use-actions-summary: 'true' + build-only-android: name: Build only (Android) runs-on: windows-latest diff --git a/.github/workflows/report-nunit.yml b/.github/workflows/report-nunit.yml deleted file mode 100644 index 9bc4d4de20..0000000000 --- a/.github/workflows/report-nunit.yml +++ /dev/null @@ -1,45 +0,0 @@ -# This is a workaround to allow PRs to report their coverage. This will run inside the base repository. -# See: -# * https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories -# * https://docs.github.com/en/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token -name: Annotate CI run with test results -on: - workflow_run: - workflows: [ "Continuous Integration" ] - types: - - completed - -permissions: - contents: read - actions: read - checks: write - -jobs: - annotate: - name: Annotate CI run with test results - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion != 'cancelled' }} - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - repository: ${{ github.event.workflow_run.repository.full_name }} - ref: ${{ github.event.workflow_run.head_sha }} - - - name: Download results - uses: actions/download-artifact@v8 - with: - pattern: osu-test-results-* - merge-multiple: true - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ github.token }} - - - name: Annotate CI run with test results - uses: dorny/test-reporter@v2.6.0 - with: - name: Results - path: "*.trx" - reporter: dotnet-trx - list-suites: 'failed' - list-tests: 'failed'