From af993b1ae183f794101d39366c9bc852c262fa2a Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Thu, 24 Nov 2022 16:20:57 +0100 Subject: [PATCH 1/3] Attempt to fix permissions --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 99a7993e..2ab1e0ce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,6 +9,7 @@ permissions: jobs: test-release: + permissions: write-all name: Test Release Build runs-on: windows-latest steps: @@ -33,6 +34,7 @@ jobs: reporter: dotnet-trx test-debug: + permissions: write-all name: Test Debug Build runs-on: windows-latest steps: From 937ef3aaec0fdd4a92fe1cb6d5582c25d0808862 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Thu, 24 Nov 2022 17:02:11 +0100 Subject: [PATCH 2/3] Use separate CI workflow to overcome issue with Dorny --- .github/workflows/test-report.yaml | 31 ++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 24 +++++++---------------- src/FSharp.Control.TaskSeq.sln | 1 + 3 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/test-report.yaml diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml new file mode 100644 index 00000000..18f70b06 --- /dev/null +++ b/.github/workflows/test-report.yaml @@ -0,0 +1,31 @@ +name: 'Test Report' + +# See Dorny instructions for why we need a separate yaml for creating a test report +# for public repositories that accept forks: +# https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories + +on: + workflow_run: + workflows: ['ci-test'] # runs after CI workflow + types: + - completed +jobs: + test-report-release: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results-release # artifact name + name: Report release 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 + + test-report-debug: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results-debug # artifact name + name: Report debug 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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2ab1e0ce..1fb0eed6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,14 +2,8 @@ name: ci-test on: [pull_request] -permissions: - id-token: write - contents: read - checks: write - jobs: test-release: - permissions: write-all name: Test Release Build runs-on: windows-latest steps: @@ -24,17 +18,15 @@ jobs: # build it, test it - name: Run dotnet test - release run: ./build.cmd ci -release - - name: Publish test results - release - uses: dorny/test-reporter@v1 - if: always() + - uses: actions/upload-artifact@v2 # upload test results + if: success() || failure() # run this step even if previous step failed with: - name: Report release tests + name: test-results-release # this path glob pattern requires forward slashes! path: ./src/FSharp.Control.TaskSeq.Test/TestResults/test-results-release.trx - reporter: dotnet-trx + test-debug: - permissions: write-all name: Test Debug Build runs-on: windows-latest steps: @@ -49,11 +41,9 @@ jobs: # build it, test it - name: Run dotnet test - debug run: ./build.cmd ci -debug - - name: Publish test results - debug - uses: dorny/test-reporter@v1 - if: always() + - uses: actions/upload-artifact@v2 # upload test results + if: success() || failure() # run this step even if previous step failed with: - name: Report debug tests + name: test-results-debug # this path glob pattern requires forward slashes! path: ./src/FSharp.Control.TaskSeq.Test/TestResults/test-results-debug.trx - reporter: dotnet-trx diff --git a/src/FSharp.Control.TaskSeq.sln b/src/FSharp.Control.TaskSeq.sln index 2e1e32f6..f3413592 100644 --- a/src/FSharp.Control.TaskSeq.sln +++ b/src/FSharp.Control.TaskSeq.sln @@ -21,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ..\.github\dependabot.yml = ..\.github\dependabot.yml ..\.github\workflows\main.yaml = ..\.github\workflows\main.yaml ..\.github\workflows\publish.yaml = ..\.github\workflows\publish.yaml + ..\.github\workflows\test-report.yaml = ..\.github\workflows\test-report.yaml ..\.github\workflows\test.yaml = ..\.github\workflows\test.yaml EndProjectSection EndProject From 375cc847076f6e3d0ed6374581954ee6f2ab4dc5 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Thu, 24 Nov 2022 17:36:35 +0100 Subject: [PATCH 3/3] Retry creating test report with Dorny --- .github/workflows/test-report.yaml | 18 ++++++++++-------- .github/workflows/test.yaml | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml index 18f70b06..82549238 100644 --- a/.github/workflows/test-report.yaml +++ b/.github/workflows/test-report.yaml @@ -1,4 +1,4 @@ -name: 'Test Report' +name: ci-report # See Dorny instructions for why we need a separate yaml for creating a test report # for public repositories that accept forks: @@ -6,26 +6,28 @@ name: 'Test Report' on: workflow_run: - workflows: ['ci-test'] # runs after CI workflow + workflows: ci-test # runs after CI workflow types: - completed jobs: test-report-release: - runs-on: ubuntu-latest + runs-on: windows-latest + name: Test report (release) steps: - uses: dorny/test-reporter@v1 with: artifact: test-results-release # artifact name - name: Report release tests # Name of the check run which will be created - path: '**/*.trx' # Path to test results (inside artifact .zip) + name: Dorny release 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 test-report-debug: - runs-on: ubuntu-latest + runs-on: windows-latest + name: Test report (debug) steps: - uses: dorny/test-reporter@v1 with: artifact: test-results-debug # artifact name - name: Report debug tests # Name of the check run which will be created - path: '**/*.trx' # Path to test results (inside artifact .zip) + name: Dorny debug 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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1fb0eed6..41a854eb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,14 +12,18 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + # setup dotnet based on global.json - name: setup-dotnet uses: actions/setup-dotnet@v3 + # build it, test it - name: Run dotnet test - release run: ./build.cmd ci -release - - uses: actions/upload-artifact@v2 # upload test results - if: success() || failure() # run this step even if previous step failed + + # upload test results + - uses: actions/upload-artifact@v2 + if: success() || failure() with: name: test-results-release # this path glob pattern requires forward slashes! @@ -35,14 +39,18 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + # setup dotnet based on global.json - name: setup-dotnet uses: actions/setup-dotnet@v3 + # build it, test it - name: Run dotnet test - debug run: ./build.cmd ci -debug - - uses: actions/upload-artifact@v2 # upload test results - if: success() || failure() # run this step even if previous step failed + + # upload test results + - uses: actions/upload-artifact@v2 + if: success() || failure() with: name: test-results-debug # this path glob pattern requires forward slashes!