-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (53 loc) · 1.84 KB
/
benchmarks.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
name: Benchmarks
on:
workflow_dispatch:
inputs:
benchmark_name:
description: 'Benchmark name'
default: '*'
required: false
jobs:
benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
env:
DOTNET_VERSION: 8.0.x
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_TieredPGO: 1
DOTNET_ReadyToRun: 0
DOTNET_TC_QuickJitForLoops: 1
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Nuget cache
uses: actions/cache@v3
with:
path:
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build -c Release
- name: Run ${{ github.event.inputs.benchmark_name }} benchmark with sudo
if: matrix.os == 'windows-latest'
run: dotnet run -c Release --no-build --filter '${{ github.event.inputs.benchmark_name }}'
working-directory: ./src/Lynx.Benchmark
- name: Run ${{ github.event.inputs.benchmark_name }} benchmark with sudo
if: matrix.os != 'windows-latest'
run: sudo dotnet run -c Release --no-build --filter '${{ github.event.inputs.benchmark_name }}'
working-directory: ./src/Lynx.Benchmark
- name: 'Upload ${{ matrix.os }} artifacts'
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: artifacts-${{ matrix.os }}-${{ github.run_number }}
# Can't include 'github.event.inputs.benchmark_name' in the name, since * is an invalid character
path: ./src/Lynx.Benchmark/BenchmarkDotNet.Artifacts/results/
if-no-files-found: error