-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (79 loc) · 2.62 KB
/
main-ci.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
name: Main CI
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: write
deployments: write
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Run Tests
run: dotnet test --configuration Release
working-directory: ./Tests
stryker:
runs-on: ubuntu-latest
env:
StrykerDirectory: ${{ github.workspace }}/Stryker
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install Stryker.NET
run: dotnet tool install -g dotnet-stryker
- name: Run Stryker.NET
id: stryker
run: |
cd Tests
dotnet stryker --config-file "./stryker-config.json" --dashboard-api-key "${{ secrets.STRYKER_DASHBOARD_API_KEY }}" --output ${{ env.StrykerDirectory }} --project "DsaDotnet.csproj" --version "main"
- uses: actions/upload-artifact@v3
with:
name: stryker-reports
if-no-files-found: error
retention-days: 3
path: ${{ env.StrykerDirectory }}/**/*
benchmark:
name: Run Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Run benchmark
working-directory: ./Benchmarks
run: dotnet run -c Release --exporters json --filter '*' --memory --join
- name: Get benchmark file name
id: benchmarkfilename
working-directory: ./Benchmarks/BenchmarkDotNet.Artifacts/results
run: |
filePath=$(find . -type f -name 'BenchmarkRun-joined-*-report-full-compressed.json' | rev | cut -d '/' -f1 | rev)
echo $filePath
echo "::set-output name=file::$filePath"
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Benchmark.Net Benchmark
tool: 'benchmarkdotnet'
output-file-path: Benchmarks/BenchmarkDotNet.Artifacts/results/${{ steps.benchmarkfilename.outputs.file }}
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@timmoth'
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Benchmark
path: Benchmark/BenchmarkDotNet.Artifacts/results/