From 9b2382bf953b76c0f6b92d77944aedd7811b83a5 Mon Sep 17 00:00:00 2001 From: s2quake Date: Thu, 27 Jun 2024 20:10:12 +0900 Subject: [PATCH] WIP --- .github/workflows/build-and-test.yml | 35 +++++-------------- .github/workflows/report-test.yml | 23 ++++++++++++ .../JSSoft.Communication.csproj | 2 +- 3 files changed, 33 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/report-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 94341fa..5ea837c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,41 +1,24 @@ name: Build and Test on: - pull_request: + pull_request: env: TEST_RESULTS_PATH: ${{ github.workspace }}/test-results.trx -permissions: - contents: read - actions: read - checks: write - jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4.1.7 - - name: Setup .NET - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/checkout@v4.1.7 + - uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.0.100 - - name: Dotnet Build - run: dotnet build --configuration Release - - name: Dotnet Test - run: | - dotnet test --configuration Release --no-restore --no-build --logger "trx;LogFileName=${{ env.TEST_RESULTS_PATH }}" - - name: Upload test results - uses: actions/upload-artifact@v4 - if: success() || failure() + - run: dotnet build --configuration Release + - run: | + dotnet test --configuration Release --no-restore --no-build \ + --logger "trx;LogFileName=${{ env.TEST_RESULTS_PATH }}" + - uses: actions/upload-artifact@v4 with: - name: test-results + name: upload-test-results path: ${{ env.TEST_RESULTS_PATH }} - - name: Upload test results - uses: dorny/test-reporter@v1.9.1 - if: success() || failure() - with: - name: XUnit Tests - path: ${{ env.TEST_RESULTS_PATH }} - reporter: dotnet-trx diff --git a/.github/workflows/report-test.yml b/.github/workflows/report-test.yml new file mode 100644 index 0000000..daeb02a --- /dev/null +++ b/.github/workflows/report-test.yml @@ -0,0 +1,23 @@ +name: Report Test +on: + workflow_run: + workflows: [Build and Test] + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + report: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: upload-test-results + name: XUnit Tests + path: "*.trx" + reporter: dotnet-trx \ No newline at end of file diff --git a/src/JSSoft.Communication/JSSoft.Communication.csproj b/src/JSSoft.Communication/JSSoft.Communication.csproj index 8f70487..de61014 100644 --- a/src/JSSoft.Communication/JSSoft.Communication.csproj +++ b/src/JSSoft.Communication/JSSoft.Communication.csproj @@ -35,7 +35,7 @@ SOFTWARE. --> runtime; build; native; contentfiles; analyzers; buildtransitive all - + \ No newline at end of file