Bump Microsoft.Testing.Extensions.TrxReport from 2.3.3 to 2.4.0 #198
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, 'feature/**'] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.github/dependabot.yml' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | |
| jobs: | |
| build-test-pack: | |
| name: Build, test and package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - name: Setup .NET from global.json | |
| uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 | |
| with: | |
| global-json-file: global.json | |
| - name: Display .NET SDK info | |
| run: dotnet --info | |
| - name: Set deterministic package timestamp | |
| run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" | |
| - name: Cache NuGet packages | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('global.json', 'Directory.Packages.props', 'Directory.Build.props', 'Directory.Build.targets', '**/packages.lock.json') }} | |
| restore-keys: nuget-${{ runner.os }}- | |
| - name: Restore | |
| run: dotnet restore CaeriusNet.slnx --locked-mode | |
| - name: Build (Release) | |
| run: dotnet build CaeriusNet.slnx --configuration Release --no-restore -p:TreatWarningsAsErrors=true | |
| - name: Test unit and compiler projects | |
| run: | | |
| set -euo pipefail | |
| for test_project in \ | |
| tests/CaeriusNet.Tests/CaeriusNet.Tests.csproj \ | |
| tests/CaeriusNet.Analyzer.Tests/CaeriusNet.Analyzer.Tests.csproj \ | |
| tests/CaeriusNet.Generator.Tests/CaeriusNet.Generator.Tests.csproj; do | |
| test_name=$(basename "$(dirname "$test_project")") | |
| dotnet test --project "$test_project" \ | |
| --configuration Release \ | |
| --no-restore \ | |
| --no-build \ | |
| --results-directory ./artifacts/test-results \ | |
| --report-trx \ | |
| --report-trx-filename "$test_name.trx" \ | |
| --coverage \ | |
| --coverage-output "$test_name.coverage.cobertura.xml" \ | |
| --coverage-output-format cobertura | |
| done | |
| - name: Pack the four release artifacts once | |
| run: | | |
| set -euo pipefail | |
| package_directory="$GITHUB_WORKSPACE/artifacts/packages" | |
| mkdir -p "$package_directory" | |
| dotnet pack src/CaeriusNet/CaeriusNet.csproj --configuration Release --no-build --output "$package_directory" | |
| dotnet pack src/CaeriusNet.Redis/CaeriusNet.Redis.csproj --configuration Release --no-build --output "$package_directory" | |
| dotnet pack src/CaeriusNet.Aspire/CaeriusNet.Aspire.csproj --configuration Release --no-build --output "$package_directory" | |
| dotnet pack src/CaeriusNet.Contracts/CaeriusNet.Contracts.csproj --configuration Release --no-build --output "$package_directory" | |
| repro_directory="$RUNNER_TEMP/caeriusnet-packages-repro" | |
| mkdir -p "$repro_directory" | |
| for project in \ | |
| src/CaeriusNet/CaeriusNet.csproj \ | |
| src/CaeriusNet.Redis/CaeriusNet.Redis.csproj \ | |
| src/CaeriusNet.Aspire/CaeriusNet.Aspire.csproj \ | |
| src/CaeriusNet.Contracts/CaeriusNet.Contracts.csproj; do | |
| dotnet pack "$project" --configuration Release --no-build --output "$repro_directory" | |
| done | |
| for artifact in "$package_directory"/*.nupkg "$package_directory"/*.snupkg; do | |
| cmp --silent "$artifact" "$repro_directory/$(basename "$artifact")" | |
| done | |
| - name: Exercise packaging acceptance tests from the packed nupkgs | |
| run: | | |
| dotnet test --project tests/CaeriusNet.Packaging.Tests/CaeriusNet.Packaging.Tests.csproj \ | |
| --configuration Release \ | |
| --no-restore \ | |
| --no-build \ | |
| --results-directory ./artifacts/test-results/packaging \ | |
| --report-trx \ | |
| --report-trx-filename packaging-results.trx \ | |
| --coverage \ | |
| --coverage-output packaging.coverage.cobertura.xml \ | |
| --coverage-output-format cobertura | |
| - name: Exercise Contracts Pull and Verify from the packed nupkg | |
| env: | |
| CAERIUS_RUN_CONTAINERS: 'true' | |
| CAERIUS_PACKAGE_DIRECTORY: ${{ github.workspace }}/artifacts/packages | |
| run: | | |
| dotnet test --project tests/CaeriusNet.IntegrationTests/CaeriusNet.IntegrationTests.csproj \ | |
| --configuration Release \ | |
| --no-restore \ | |
| --no-build \ | |
| --filter-class "*ContractsPackageAcceptanceTests*" \ | |
| --results-directory ./artifacts/test-results/contracts \ | |
| --report-trx \ | |
| --report-trx-filename contracts-results.trx \ | |
| --coverage \ | |
| --coverage-output contracts.coverage.cobertura.xml \ | |
| --coverage-output-format cobertura | |
| - name: Validate packed artifacts with the repository verifier | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| & ./.github/scripts/ValidatePackage.ps1 ` | |
| -Configuration Release ` | |
| -PackageDirectory "$env:GITHUB_WORKSPACE/artifacts/packages" ` | |
| -OutputDirectory "$env:RUNNER_TEMP/caeriusnet-package-validation" | |
| - name: Verify Source Link | |
| shell: pwsh | |
| run: | | |
| & ./.github/scripts/ValidateSourceLink.ps1 ` | |
| -Configuration Release ` | |
| -PackageDirectory "$env:GITHUB_WORKSPACE/artifacts/packages" | |
| - name: Restore four isolated consumers from the packed packages | |
| run: bash ./.github/scripts/ValidatePackageConsumers.sh "$GITHUB_WORKSPACE/artifacts/packages" "$RUNNER_TEMP/caeriusnet-consumers" | |
| - name: Upload packages | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: caeriusnet-packages | |
| path: artifacts/packages/* | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Upload test results and coverage | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: test-results-and-coverage | |
| path: | | |
| artifacts/test-results/**/*.trx | |
| artifacts/test-results/**/*.coverage.cobertura.xml | |
| retention-days: 14 | |
| if-no-files-found: warn | |
| - name: Upload coverage to Codecov | |
| if: success() | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: artifacts/test-results/**/*.coverage.cobertura.xml | |
| flags: unittests | |
| name: caeriusnet-coverage | |
| fail_ci_if_error: false |