From 3d31e4787154192db318a5920a6c637c212cb103 Mon Sep 17 00:00:00 2001 From: s2quake Date: Sat, 15 Jun 2024 20:21:20 +0900 Subject: [PATCH] ci: Add test report action. --- .github/workflows/build-and-test.yml | 7 +++---- .github/workflows/test-report.yml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c35b886..01d1e2f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -11,16 +11,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.7 - - name: Setup .NET Core - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.0.100 - run: dotnet build --configuration Release - run: | dotnet test --configuration Release --no-restore --no-build \ - --logger "trx;LogFileName=$(PWD)/logs/test-results.trx" + --logger "trx;LogFileName=$PWD/logs/test-results.trx" - uses: actions/upload-artifact@v4 # upload test results if: success() || failure() # run this step even if previous step failed with: name: test-results - path: $(PWD)/logs/test-results.trx + path: $PWD/logs/test-results.trx diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..e74e874 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,20 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['Build and Test'] # runs after CI workflow + types: + - completed +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1.9.1 + with: + artifact: test-results # artifact name + name: XUnit Tests # Name of the check run which will be created + path: '*.trx' # Path to test results (inside artifact .zip) + reporter: dotnet-trx # Format of test results \ No newline at end of file