-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (57 loc) · 2.2 KB
/
benchmark-pull-request.yaml
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
name: Benchmark PR
on:
pull_request:
paths: ["projects/**"]
types: [opened, reopened, synchronize, labeled]
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
benchmarks_stub:
name: Run benchmarks for pr
if: "${{ !contains(github.event.pull_request.labels.*.name, 'ci: benchmark') }}"
runs-on: ubuntu-latest
steps:
- run: echo "Fake job if label is not set"
benchmarks:
name: Run benchmarks for pr
if: "${{ contains(github.event.pull_request.labels.*.name, 'ci: benchmark') }}"
runs-on: benchmarking-runner
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: projects/${{ github.event.pull_request.head.repo.owner.login }}/**
- name: Check for unrelated changes
if: steps.changed-files.outputs.other_modified_files_count != 0
run: |
echo "Found changes in the files outside of the participant project folder"
echo "Check the rules and make changes/additions only inside projects/${{ github.event.pull_request.head.repo.owner.login }}"
echo "Following files have changes:"
echo ${{ steps.changed-files.outputs.other_modified_files }}
exit 1
- name: Install Stable Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Wrk
run: sudo apt-get update && sudo apt-get install -y wrk
- name: Install Tools for reference implementation
run: npm i -g @tailcallhq/tailcall
- name: Build mock-server
run: cargo build -p mock-api --release
- name: Run Benchmarks
run: cargo run -- --project ${{ github.event.pull_request.head.repo.owner.login }}
- name: Generate comment
run: ./comment.sh $( cat results/${{ github.event.pull_request.head.repo.owner.login }}/score.out )
- name: Show comment body
run: cat body.md
- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
name: body
path: body.md