Skip to content

Feature/fix vulnerabilities (#39) #142

Feature/fix vulnerabilities (#39)

Feature/fix vulnerabilities (#39) #142

Workflow file for this run

name: benchmark
on:
push:
tags:
- v*
pull_request:
branches: [feature/*]
jobs:
build:
env:
APP: "${{ github.workspace }}/src"
PROJECT_BENCH: "./bench/Spinner.Benchmark"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Build Version 🏷️
run: |
Import-Module .\nupkgs\GetBuildVersion.psm1
Write-Host $Env:GITHUB_REF
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Setup NuGet 🔧
uses: NuGet/setup-nuget@v1.0.5
- name: Setup .NET Core SDK 6.0 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET Core SDK 8.0 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.400
- name: Clean Dependencies 📦
run: dotnet clean ${{env.PROJECT_BENCH }}
- name: Restore Dependencies 📦
run: dotnet restore ${{env.PROJECT_BENCH }}
- name: Build ⚙️
run: dotnet build ${{env.PROJECT_BENCH }} -c Release -p:Version=$BUILD_VERSION --no-restore
- name: Publish 📮
run: dotnet publish ${{env.PROJECT_BENCH }} -f net8.0 -c Release --verbosity normal -o ./publish.benchmarks/
- name: Run 🏋️‍♂️
if: github.event_name == 'pull_request'
run: dotnet ./publish.benchmarks/Spinner.Benchmark.dll -f "Spinner.Benchmark.*"
- name: Upload Results 📂
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Benchmark_Results
path: ./BenchmarkDotNet.Artifacts/results/*