Update dotnet.yml #4
This file contains 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: Speed Comparison | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
inputs: | |
publish-packages: | |
description: Publish packages? | |
type: boolean | |
required: true | |
jobs: | |
run-time-benchmarks: | |
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
class: [RepeatTests, BasicTest] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
group: "speed-comparison-run-time-${{matrix.os}}-${{matrix.class}}" | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build TUnit AOT | |
run: dotnet publish TUnitTimer.csproj -c Release --output aot-publish --property:Aot=true --runtime ${{ matrix.os == 'windows-latest' && 'win-x64' || matrix.os == 'ubuntu-latest' && 'linux-x64' || 'osx-x64' }} | |
working-directory: "tools/speed-comparison/TUnitTimer/TUnitTimer" | |
- name: Build TUnit Single File | |
run: dotnet publish TUnitTimer.csproj -c Release --output singlefile-publish --property:SingleFile=true --runtime ${{ matrix.os == 'windows-latest' && 'win-x64' || matrix.os == 'ubuntu-latest' && 'linux-x64' || 'osx-x64' }} | |
working-directory: "tools/speed-comparison/TUnitTimer/TUnitTimer" | |
- name: Build TUnit | |
run: dotnet build -c Release | |
working-directory: "tools/speed-comparison/TUnitTimer" | |
- name: Build xUnit | |
run: dotnet build -c Release | |
working-directory: "tools/speed-comparison/xUnitTimer" | |
- name: Build NUnit | |
run: dotnet build -c Release | |
working-directory: "tools/speed-comparison/NUnitTimer" | |
- name: Build MSTest | |
run: dotnet build -c Release | |
working-directory: "tools/speed-comparison/MSTestTimer" | |
- name: Run Benchmark | |
run: ${{ matrix.os != 'windows-latest' && 'sudo -E ' || '' }}dotnet run -c Release --allCategories=Runtime | |
working-directory: "tools/speed-comparison/Tests.Benchmark" | |
env: | |
CLASS_NAME: ${{ matrix.class }} | |
- name: Upload Markdown | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{ matrix.os }}_markdown_run_time_${{ matrix.class }} | |
path: | | |
**/BenchmarkDotNet.Artifacts/** | |
build-time-benchmarks: | |
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
group: "speed-comparison-build-time-${{matrix.os}}" | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Run Benchmark | |
run: ${{ matrix.os != 'windows-latest' && 'sudo -E ' || '' }}dotnet run -c Release --allCategories=Build | |
working-directory: "tools/speed-comparison/Tests.Benchmark" | |
- name: Upload Markdown | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{ matrix.os }}_markdown_build_time | |
path: | | |
**/BenchmarkDotNet.Artifacts/** |