-
Notifications
You must be signed in to change notification settings - Fork 58
133 lines (126 loc) · 5.22 KB
/
merge-tests.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Run final tests only when attempting to merge, shown as skipped status checks beforehand
name: Merge group tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [master]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
linux-ignored:
if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
runs-on: buildjet-16vcpu-ubuntu-2204
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Linux Tests
run: |
cargo nextest run --profile ci --workspace --cargo-profile dev-ci --run-ignored ignored-only -E 'all() - test(groth16::tests::outer_prove_recursion) - test(test_make_fcomm_examples) - test(test_functional_commitments_demo) - test(test_chained_functional_commitments_demo)'
linux-arm:
if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
runs-on: buildjet-16vcpu-ubuntu-2204-arm
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Linux Tests
run: |
cargo nextest run --profile ci --workspace --cargo-profile dev-ci
- name: Linux Gadget Tests w/o debug assertions
run: |
cargo nextest run --profile ci --workspace --cargo-profile dev-no-assertions -E 'test(circuit::gadgets)'
mac-m1:
if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Linux Tests
run: |
cargo nextest run --profile ci --workspace --cargo-profile dev-ci
- name: Linux Gadget Tests w/o debug assertions
run: |
cargo nextest run --profile ci --workspace --cargo-profile dev-no-assertions -E 'test(circuit::gadgets)'
# TODO: Make this a required status check
# Run comparative benchmark against master, reject on regression
gpu-benchmark:
if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
name: Run fibonacci bench on GPU
runs-on: [self-hosted, gpu-bench]
steps:
# TODO: Factor out GPU setup into an action or into justfile, it's used in 4 places
# Set up GPU
# Check we have access to the machine's Nvidia drivers
- run: nvidia-smi
# Check that CUDA is installed with a driver-compatible version
# This must also be compatible with the GPU architecture, see above link
- run: nvcc --version
- uses: actions/checkout@v4
# Install dependencies
- uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Install criterion
run: |
cargo install cargo-criterion
cargo install criterion-table
# Checkout base branch for comparative bench
- uses: actions/checkout@v4
with:
ref: master
path: master
# Copy the script so the base can bench with the same parameters
- name: Copy source script to base branch
run: cp justfile bench.env ../master/benches
working-directory: ${{ github.workspace }}/benches
- name: Set base ref variable
run: echo "BASE_REF=$(git rev-parse HEAD)" | tee -a $GITHUB_ENV
working-directory: ${{ github.workspace }}/master
- name: Run GPU bench on base branch
run: just --dotenv-filename bench.env gpu-bench fibonacci_lem
working-directory: ${{ github.workspace }}/master/benches
- name: Copy bench output to PR branch
run: |
mkdir -p target
cp -r master/target/criterion target
cp master/${{ env.BASE_REF }}.json .
- name: Run GPU bench on PR branch
run: just --dotenv-filename bench.env gpu-bench fibonacci_lem
working-directory: ${{ github.workspace }}/benches
# Create a `criterion-table` and write in commit comment
- name: Run `criterion-table`
run: cat ${{ github.sha }}.json | criterion-table > BENCHMARKS.md
- name: Write bench on commit comment
uses: peter-evans/commit-comment@v3
with:
body-path: BENCHMARKS.md
# TODO: Use jq for JSON parsing if needed
# Check for benchmark regression based on Criterion's configured noise threshold
- name: Performance regression check
id: check-regression
run: echo "regress_count=$(grep -c 'Regressed' ${{ github.sha }}.json)" | tee -a $GITHUB_OUTPUT
# Fail job if regression found
- uses: actions/github-script@v6
if: ${{ steps.check-regression.outputs.regress_count > 0 }}
with:
script: |
core.setFailed('Fibonacci bench regression detected')