Run selected tests (windows-2019 --framework net8.0 --filter DisassemblyDiagnoserTests) #108
  
    
      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: run-tests-selected | |
| run-name: Run selected tests (${{ inputs.runs_on }} --framework ${{ inputs.framework}} --filter ${{ inputs.filter }}) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| runs_on: | |
| type: choice | |
| description: GitHub Actions runner image name | |
| required: true | |
| default: ubuntu-latest | |
| options: | |
| - windows-latest | |
| - windows-2019 | |
| - windows-2025 | |
| - windows-11-arm | |
| - ubuntu-latest | |
| - ubuntu-24.04-arm | |
| - macos-latest | |
| - macos-13 | |
| project: | |
| type: string | |
| description: Specify test project path | |
| required: true | |
| default: tests/BenchmarkDotNet.IntegrationTests | |
| options: | |
| - tests/BenchmarkDotNet.Tests | |
| - tests/BenchmarkDotNet.IntegrationTests | |
| - tests/BenchmarkDotNet.IntegrationTests.ManualRunning | |
| framework: | |
| type: choice | |
| description: Specify target framework | |
| required: true | |
| options: | |
| - net8.0 | |
| - net462 | |
| filter: | |
| type: string | |
| description: Test filter text (It's used for `dotnet test --filter`) Use default value when running all tests | |
| required: true | |
| default: "BenchmarkDotNet" | |
| iteration_count: | |
| type: number | |
| description: Count of test loop (It's expected to be used for flaky tests) | |
| required: true | |
| default: 1 | |
| jobs: | |
| test: | |
| name: test (${{ inputs.runs_on }} --framework ${{ inputs.framework}} --filter ${{ inputs.filter }}) | |
| runs-on: ${{ inputs.runs_on }} | |
| timeout-minutes: 60 # Explicitly set timeout. When wrong input parameter is passed. It may continue to run until it times out (Default:360 minutes)) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # | |
| - name: Setup | |
| run: | | |
| dotnet tool install -g dotnet-gcdump | |
| mkdir artifacts | |
| # Build | |
| - name: Run build | |
| working-directory: ${{ github.event.inputs.project }} | |
| run: | | |
| dotnet build -c Release --framework ${{ inputs.framework }} -tl:off | |
| # Test | |
| - name: Run tests | |
| shell: pwsh | |
| working-directory: ${{ github.event.inputs.project }} | |
| run: | | |
| $PSNativeCommandUseErrorActionPreference = $true | |
| foreach($i in 1..${{ inputs.iteration_count }}) { | |
| Write-Host ('##[group]Executing Iteration: {0}/${{ inputs.iteration_count }}' -f $i) | |
| dotnet test -c Release --framework ${{ inputs.framework }} --filter ${{ inputs.filter }} -tl:off --no-build --logger:"console;verbosity=normal" | |
| Write-Host '##[endgroup]' | |
| } | |
| # Upload artifact files that are located at `$(GITHUB_WORKSPACE)/artifacts` directory | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: results | |
| if-no-files-found: ignore | |
| path: | | |
| artifacts/**/* |