refactor: use nameof operator for argument name in exception throwing #274
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: [push, pull_request] | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| jobs: | |
| build: | |
| name: ${{ matrix.platform.name }} ${{ matrix.dotnet.name }} | |
| runs-on: ${{ matrix.platform.os }} | |
| #runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - { name: Linux, os: ubuntu-24.04 } | |
| - { name: Windows, os: windows-2022 } | |
| - { name: macOS, os: macos-15 } | |
| dotnet: | |
| - { name: .NET 9, version: "9.0.x" } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: setup-dotnet | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet.version }} | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '21' | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache SonarCloud scanner | |
| id: cache-sonar-scanner | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./.sonar/scanner | |
| key: ${{ runner.os }}-sonar-scanner | |
| restore-keys: ${{ runner.os }}-sonar-scanner | |
| - name: Install SonarCloud scanner | |
| if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
| shell: pwsh | |
| run: | | |
| dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner | |
| - name: Enforce SDK Version | |
| run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force | |
| - name: build and analyze | |
| shell: pwsh | |
| run: | | |
| dotnet tool install --global dotnet-coverage | |
| dotnet restore | |
| ./.sonar/scanner/dotnet-sonarscanner begin /k:"magic5644_codeLineCounter" /o:"magic5644" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false | |
| dotnet build --no-incremental | |
| dotnet-coverage collect 'dotnet test --no-build --results-directory "test-results" --collect:"Code Coverage"' -f xml -o 'coverage.xml' | |
| dotnet-coverage merge --output coverage.xml --output-format xml "test-results/**/*.coverage" | |
| ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |