From 4df07b2013c880f20646c50a30ce6aea5a0575e5 Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Fri, 8 Dec 2023 11:24:43 -0500 Subject: [PATCH 1/2] Update workflow - add workflow_dispatch event to manually trigger workflow - add step to publish test reporter - add step to upload artifact --- .github/workflows/dotnet-desktop.yml | 21 ++++++++++++++++----- .gitignore | 3 ++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index e1f3075..7cc5623 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -1,6 +1,6 @@ # Build DSIronPython package using msbuild name: DSIronPython-VS2022Build -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: build: runs-on: windows-2022 @@ -13,7 +13,7 @@ jobs: - name: Setup nuget uses: nuget/setup-nuget@v1.2 - name: Setup msbuild - uses: microsoft/setup-msbuild@v1.3 + uses: microsoft/setup-msbuild@v1.3.1 - name: Nuget Restore DSIronPython solution run: nuget restore ${{ github.workspace }}\DSIronPython\DSIronPython.sln - name: Build DSIronPython with MSBuild @@ -28,6 +28,17 @@ jobs: } else { Write-Error "python node dll was not found!" } - - name: Test with the dotnet CLI - run: dotnet test ${{ github.workspace }}\DSIronPython - + - name: Run test with the dotnet CLI + run: | + dotnet test ${{ github.workspace }}\DSIronPython --logger trx --results-directory ${{ github.workspace }}\DSIronPython\TestResults + - name: Publish test results + uses: bibipkins/dotnet-test-reporter@v1.3.3 + with: + github-token: ${{ github.token }} + results-path: ${{ github.workspace }}/DSIronPython/TestResults/*.trx + - name: Upload build artifact + uses: actions/upload-artifact@v3.1.3 + with: + name: DSIronPython + path: ${{ github.workspace }}\DSIronPython\package_output + retention-days: 7 diff --git a/.gitignore b/.gitignore index 9491a2f..d4d380b 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ bld/ [Oo]ut/ [Ll]og/ [Ll]ogs/ +package_output/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -360,4 +361,4 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd From 986ed891c995de2bc14c0e2b859c6bacb6c5be19 Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Fri, 8 Dec 2023 13:55:08 -0500 Subject: [PATCH 2/2] Use different workflow for publishing test report --- .../{dotnet-desktop.yml => build.yml} | 13 +++++----- .github/workflows/publish_test_report.yml | 25 +++++++++++++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) rename .github/workflows/{dotnet-desktop.yml => build.yml} (83%) create mode 100644 .github/workflows/publish_test_report.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/build.yml similarity index 83% rename from .github/workflows/dotnet-desktop.yml rename to .github/workflows/build.yml index 7cc5623..11eb86b 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/build.yml @@ -30,15 +30,16 @@ jobs: } - name: Run test with the dotnet CLI run: | - dotnet test ${{ github.workspace }}\DSIronPython --logger trx --results-directory ${{ github.workspace }}\DSIronPython\TestResults - - name: Publish test results - uses: bibipkins/dotnet-test-reporter@v1.3.3 - with: - github-token: ${{ github.token }} - results-path: ${{ github.workspace }}/DSIronPython/TestResults/*.trx + dotnet test ${{ github.workspace }}\DSIronPython --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DSIronPython\TestResults - name: Upload build artifact uses: actions/upload-artifact@v3.1.3 with: name: DSIronPython path: ${{ github.workspace }}\DSIronPython\package_output retention-days: 7 + - name: Upload test artifact + uses: actions/upload-artifact@v3.1.3 + with: + name: TestResults + path: ${{ github.workspace }}\DSIronPython\TestResults + retention-days: 1 diff --git a/.github/workflows/publish_test_report.yml b/.github/workflows/publish_test_report.yml new file mode 100644 index 0000000..1cb9adb --- /dev/null +++ b/.github/workflows/publish_test_report.yml @@ -0,0 +1,25 @@ +name: Publish Test Report + +on: + workflow_run: + workflows: + - DSIronPython-VS2022Build + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + publish_test_report: + name: Publish Test Report + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1.7.0 + with: + artifact: TestResults + name: Test Results + path: '*.trx' + reporter: dotnet-trx