-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (82 loc) · 2.65 KB
/
workflow.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: all the things
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_FRAMEWORK: net8.0
DOTNET_VERSION: 8.0.x
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🚧 Checkout
uses: actions/checkout@main
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work
- name: 🔨 Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 🏗️ Run dotnet build
id: build
run: dotnet build -c release
- name: 🎨 Run dotnet format
id: format
run: dotnet format --verbosity diagnostic --verify-no-changes --no-restore
- name: 🧪 Run dotnet test
id: test
run: dotnet test -c release --no-restore
benchmark:
if: ${{ github.event_name == 'push' }}
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: 🚧 Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: 🔨 Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: ⚗ Run benchmarks
id: run-benchmarks
run: |
dotnet run \
--framework ${{ env.DOTNET_FRAMEWORK }} \
--configuration release \
--project ./tests/Lolcat.Benchmarks/Lolcat.Benchmarks.csproj
- name: 🚚 Store benchmarks
id: store-benchmarks
uses: benchmark-action/[email protected]
with:
name: Benchmarks
tool: benchmarkdotnet
output-file-path: BenchmarkDotNet.Artifacts/results/Lolcat.Benchmarks.Benchmarks-report.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
publish:
if: ${{ github.event_name == 'workflow_dispatch' }}
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: 🚧 Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: 🔨 Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 📦️ Package
run: dotnet pack -c release ./src/Lolcat/Lolcat.csproj
- name: 🚀 Publish
run: dotnet nuget push ./src/Lolcat/**/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}