-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.62 KB
/
Copy pathci.yml
File metadata and controls
76 lines (63 loc) · 2.62 KB
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
name: CI
on:
push:
branches:
- main
- master
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore MLIR.slnx
- name: Build
run: dotnet build MLIR.slnx --configuration Release --no-restore
- name: Test
run: dotnet test MLIR.slnx --configuration Release --no-build
- name: Run head benchmarks
run: dotnet run --project tools/TableGen.Benchmarks/TableGen.Benchmarks.csproj -c Release --no-build -- run --output artifacts/benchmarks/head.json --warmup-duration-ms 250 --duration-ms 1000
- name: Benchmark summary
if: github.event_name != 'pull_request'
run: |
{
echo "## TableGen Interpreter Benchmarks"
echo
echo "Head benchmark results were written to \`artifacts/benchmarks/head.json\`."
} >> "$GITHUB_STEP_SUMMARY"
- name: Run base benchmarks
if: github.event_name == 'pull_request'
run: |
git worktree add /tmp/mlir-base "${{ github.event.pull_request.base.sha }}"
dotnet run --project /tmp/mlir-base/tools/TableGen.Benchmarks/TableGen.Benchmarks.csproj -c Release -- run --output /tmp/mlir-base/artifacts/benchmarks/base.json --warmup-duration-ms 250 --duration-ms 1000
- name: Compare benchmark results
if: github.event_name == 'pull_request'
run: |
dotnet run --project tools/TableGen.Benchmarks/TableGen.Benchmarks.csproj -c Release --no-build -- compare --baseline /tmp/mlir-base/artifacts/benchmarks/base.json --candidate artifacts/benchmarks/head.json --output artifacts/benchmarks/compare.md
cat artifacts/benchmarks/compare.md >> "$GITHUB_STEP_SUMMARY"
- name: Publish sticky benchmark PR comment
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: marocchino/sticky-pull-request-comment@v2
with:
header: tablegen-benchmarks
path: artifacts/benchmarks/compare.md
recreate: true
- name: Upload benchmark artifacts
uses: actions/upload-artifact@v4
with:
name: tablegen-benchmarks
if-no-files-found: ignore
path: |
artifacts/benchmarks/head.json
artifacts/benchmarks/compare.md