From 057d08226266672724379e523792afada4dab3c9 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:18:43 -0700 Subject: [PATCH 1/8] build parallel --- .github/workflows/gate.yml | 329 ++++++++++++++----------------------- 1 file changed, 124 insertions(+), 205 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index d5200d63..341e6e61 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -8,216 +8,135 @@ on: branches: [ main ] jobs: - win: - - runs-on: windows-latest - - permissions: - checks: write - - steps: - - uses: actions/checkout@v4 - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 3.1.x - - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Test (4.8) - run: dotnet test --no-restore --verbosity normal -f net48 --logger "trx;LogFileName=results4.trx" - - name: Upload test results (4.8) - uses: actions/upload-artifact@v4 # upload test results - if: success() || failure() # run this step even if previous step failed - with: - name: test-results-win48 - path: BitFaster.Caching.UnitTests/TestResults/results4.trx - - - name: Test (3.1) - run: dotnet test --no-restore --verbosity normal -f netcoreapp3.1 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results3.trx" - - name: Upload test results (3.1) - uses: actions/upload-artifact@v4 # upload test results - if: success() || failure() # run this step even if previous step failed - with: - name: test-results-win3 - path: BitFaster.Caching.UnitTests/TestResults/results3.trx - - name: Publish coverage report to coveralls.io (3.1) - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.netcoreapp3.1.info - flag-name: win3 - parallel: true - - - name: Publish NuGet artifacts - uses: actions/upload-artifact@v4 - with: - name: NuGet package - path: BitFaster.Caching/bin/Release/ - win2: - - runs-on: windows-latest - - permissions: - checks: write - - steps: - - uses: actions/checkout@v4 - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.0.x - 8.0.x - 9.0.x - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Test (6.0) - run: dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results6.trx" - - name: Upload test results (6.0) - uses: actions/upload-artifact@v4 # upload test results - if: success() || failure() # run this step even if previous step failed - with: - name: test-results-win6 - path: BitFaster.Caching.UnitTests/TestResults/results6.trx - - name: Upload test results (6.0 .NET Std) - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: test-results-win6-std - path: BitFaster.Caching.UnitTests.Std/TestResults/results6.trx - - - name: Publish coverage report to coveralls.io (6.0) - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.net6.0.info - flag-name: win6 - parallel: true - - - name: Test (9.0) - run: dotnet test --no-restore --verbosity normal -f net9.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results9.trx" - - name: Upload test results (9.0) - uses: actions/upload-artifact@v4 # upload test results - if: success() || failure() # run this step even if previous step failed - with: - name: test-results-win9 - path: BitFaster.Caching.UnitTests/TestResults/results9.trx - - name: Upload test results (9.0 .NET Std) - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: test-results-win9-std - path: BitFaster.Caching.UnitTests.Std/TestResults/results9.trx - - - name: Publish coverage report to coveralls.io (9.0) - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.net9.0.info - flag-name: win9 - parallel: true - - mac: - - runs-on: macos-latest - - permissions: - checks: write - - steps: - - uses: actions/checkout@v4 - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.0.x - 8.0.x - 9.0.x - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results.trx" - - name: Publish coverage report to coveralls.io - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.net6.0.info - flag-name: mac - parallel: true - - name: Upload test results (6.0) - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: test-results-mac - path: BitFaster.Caching.UnitTests/TestResults/results.trx - - name: Upload test results (6.0 .NET Std) - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: test-results-mac-std - path: BitFaster.Caching.UnitTests.Std/TestResults/results.trx - - linux: - - runs-on: ubuntu-latest - + build: + name: Build and Test (${{ matrix.os }}, .NET ${{ matrix.dotnet-version }}, ${{ matrix.framework }}) + runs-on: ${{ matrix.os }} permissions: checks: write + strategy: + matrix: + include: + # Windows + - os: windows-latest + dotnet-version: 3.1.x + framework: net48 + coverage: false + results: results4.trx + artifact: test-results-win48 + std: false + flag: "" + publish_nuget: true + + - os: windows-latest + dotnet-version: 3.1.x + framework: netcoreapp3.1 + coverage: true + results: results3.trx + artifact: test-results-win3 + std: false + flag: win3 + publish_nuget: true + + - os: windows-latest + dotnet-version: 6.0.x + framework: net6.0 + coverage: true + results: results6.trx + artifact: test-results-win6 + std: true + flag: win6 + publish_nuget: false + + - os: windows-latest + dotnet-version: 9.0.x + framework: net9.0 + coverage: true + results: results9.trx + artifact: test-results-win9 + std: true + flag: win9 + publish_nuget: false + + # macOS + - os: macos-latest + dotnet-version: 6.0.x + framework: net6.0 + coverage: true + results: results.trx + artifact: test-results-mac + std: true + flag: mac + publish_nuget: false + + # Linux + - os: ubuntu-latest + dotnet-version: 6.0.x + framework: net6.0 + coverage: true + results: results.trx + artifact: test-results-linux + std: true + flag: linux + publish_nuget: false steps: - - uses: actions/checkout@v4 - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.0.x - 8.0.x - 9.0.x - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results.trx" - - name: Publish coverage report to coveralls.io - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.net6.0.info - flag-name: linux - parallel: true - - name: Upload test results (6.0) - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: test-results-linux - path: BitFaster.Caching.UnitTests/TestResults/results.trx - - name: Upload test results (6.0 .NET Std) - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: test-results-linux-std - path: BitFaster.Caching.UnitTests.Std/TestResults/results.trx + - uses: actions/checkout@v4 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: | + dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} \ + ${{ matrix.coverage && '/p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov' || '' }} \ + --logger "trx;LogFileName=${{ matrix.results }}" + shell: bash + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: ${{ matrix.artifact }} + path: BitFaster.Caching.UnitTests/TestResults/${{ matrix.results }} + + - name: Upload test results (.NET Std) + if: ${{ matrix.std }} + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }}-std + path: BitFaster.Caching.UnitTests.Std/TestResults/${{ matrix.results }} + + - name: Publish coverage report to coveralls.io + if: ${{ matrix.coverage && matrix.flag != '' }} + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.${{ matrix.framework }}.info + flag-name: ${{ matrix.flag }} + parallel: true + + - name: Publish NuGet artifacts + if: ${{ matrix.publish_nuget }} + uses: actions/upload-artifact@v4 + with: + name: NuGet package + path: BitFaster.Caching/bin/Release/ coverage: - - needs: [win, win2, mac, linux] - + name: Coveralls Finished + needs: build runs-on: ubuntu-latest - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true \ No newline at end of file + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true \ No newline at end of file From 2af667673ab7586ba284d941dae502a792c014d5 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:23:32 -0700 Subject: [PATCH 2/8] install all fwks --- .github/workflows/gate.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 341e6e61..914b75ee 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -18,7 +18,6 @@ jobs: include: # Windows - os: windows-latest - dotnet-version: 3.1.x framework: net48 coverage: false results: results4.trx @@ -28,7 +27,6 @@ jobs: publish_nuget: true - os: windows-latest - dotnet-version: 3.1.x framework: netcoreapp3.1 coverage: true results: results3.trx @@ -38,7 +36,6 @@ jobs: publish_nuget: true - os: windows-latest - dotnet-version: 6.0.x framework: net6.0 coverage: true results: results6.trx @@ -48,7 +45,6 @@ jobs: publish_nuget: false - os: windows-latest - dotnet-version: 9.0.x framework: net9.0 coverage: true results: results9.trx @@ -59,7 +55,6 @@ jobs: # macOS - os: macos-latest - dotnet-version: 6.0.x framework: net6.0 coverage: true results: results.trx @@ -70,7 +65,6 @@ jobs: # Linux - os: ubuntu-latest - dotnet-version: 6.0.x framework: net6.0 coverage: true results: results.trx @@ -85,7 +79,11 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: ${{ matrix.dotnet-version }} + dotnet-version: | + 3.1.x + 6.0.x + 8.0.x + 9.0.x - name: Install dependencies run: dotnet restore From be98e5b87aef24f33b892f16ca7542e73f945fe4 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:29:50 -0700 Subject: [PATCH 3/8] cleanup --- .github/workflows/gate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 914b75ee..62437915 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -9,10 +9,11 @@ on: jobs: build: - name: Build and Test (${{ matrix.os }}, .NET ${{ matrix.dotnet-version }}, ${{ matrix.framework }}) + name: ${{ matrix.framework }} ${{ matrix.os }} runs-on: ${{ matrix.os }} permissions: checks: write + continue-on-error: true strategy: matrix: include: @@ -23,7 +24,7 @@ jobs: results: results4.trx artifact: test-results-win48 std: false - flag: "" + flag: net48 publish_nuget: true - os: windows-latest From 8b690949ce52bd57cf54c83f5a59608953126c35 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:35:13 -0700 Subject: [PATCH 4/8] 1line --- .github/workflows/gate.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 62437915..76f7a9c3 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -94,9 +94,7 @@ jobs: - name: Test run: | - dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} \ - ${{ matrix.coverage && '/p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov' || '' }} \ - --logger "trx;LogFileName=${{ matrix.results }}" + dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} ${{ matrix.coverage && '/p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov' || '' }} --logger "trx;LogFileName=${{ matrix.results }}" shell: bash - name: Upload test results From aea7bf26b59abfba3692f4bf0a1f6b8bccc1d364 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:45:22 -0700 Subject: [PATCH 5/8] gitbash --- .github/workflows/gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 76f7a9c3..5db233ea 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -95,7 +95,7 @@ jobs: - name: Test run: | dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} ${{ matrix.coverage && '/p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov' || '' }} --logger "trx;LogFileName=${{ matrix.results }}" - shell: bash + shell: gitbash - name: Upload test results uses: actions/upload-artifact@v4 From d5a63986054f777417e13a180cbca528ab672fb7 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:50:30 -0700 Subject: [PATCH 6/8] isolate --- .github/workflows/gate.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 5db233ea..19942ae3 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -94,8 +94,12 @@ jobs: - name: Test run: | - dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} ${{ matrix.coverage && '/p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov' || '' }} --logger "trx;LogFileName=${{ matrix.results }}" - shell: gitbash + dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} \ + ${{ matrix.coverage && '/p:CollectCoverage=true' || '' }} \ + ${{ matrix.coverage && '/p:CoverletOutput=TestResults/' || '' }} \ + ${{ matrix.coverage && '/p:CoverletOutputFormat=lcov' || '' }} \ + --logger "trx;LogFileName=${{ matrix.results }}" + shell: bash - name: Upload test results uses: actions/upload-artifact@v4 From 0f5418574c8356239a984d3dfa5f4fc3e862e7d9 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 19:59:26 -0700 Subject: [PATCH 7/8] hyphen --- .github/workflows/gate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 19942ae3..a8a58051 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -95,10 +95,10 @@ jobs: - name: Test run: | dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} \ - ${{ matrix.coverage && '/p:CollectCoverage=true' || '' }} \ - ${{ matrix.coverage && '/p:CoverletOutput=TestResults/' || '' }} \ - ${{ matrix.coverage && '/p:CoverletOutputFormat=lcov' || '' }} \ - --logger "trx;LogFileName=${{ matrix.results }}" + ${{ matrix.coverage && '-p:CollectCoverage=true' || '' }} \ + ${{ matrix.coverage && '-p:CoverletOutput=TestResults/' || '' }} \ + ${{ matrix.coverage && '-p:CoverletOutputFormat=lcov' || '' }} \ + --logger "trx;LogFileName=${{ matrix.results }}" shell: bash - name: Upload test results From 94e97fb94a629a06d2bcaf170eebe4d61be79116 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Sat, 28 Jun 2025 20:11:37 -0700 Subject: [PATCH 8/8] publish once --- .github/workflows/gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index a8a58051..1816acd9 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -34,7 +34,7 @@ jobs: artifact: test-results-win3 std: false flag: win3 - publish_nuget: true + publish_nuget: false - os: windows-latest framework: net6.0