-
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (58 loc) · 2.06 KB
/
ci-benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: benchmark
on:
push:
tags:
- v*
pull_request:
branches: [feature/*]
jobs:
build:
env:
APP: "${{ github.workspace }}/app"
PROJECT_BIN5: "./app/Spinner/bin/Release/net5.0"
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 3.1 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET Core SDK 5.0 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup .NET Core SDK 6.0 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET Core SDK 7.0 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.305
- 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 net6.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@v2
with:
name: Benchmark_Results
path: ./BenchmarkDotNet.Artifacts/results/*