-
Notifications
You must be signed in to change notification settings - Fork 6
221 lines (210 loc) · 7.72 KB
/
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Tests
on:
push:
branches: [main, dev]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
name: CI Test Suite
runs-on: warp-ubuntu-latest-x64-32x
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- name: Setup CI
uses: ./.github/actions/setup
with:
pull_token: ${{ secrets.REPO_TOKEN }}
- name: Run cargo test on sphinx except the test_e2e_prove_groth16 recursion test
run: |
cargo nextest run --cargo-profile dev-ci --profile ci --workspace -E 'all() - test(test_e2e_prove_groth16)'
- name: Run cargo test with no default features
run: |
cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features debug -- cpu::trace::tests::generate_trace
working-directory: ${{ github.workspace }}/examples
- name: Install `cargo prove` CLI
run: |
cargo install --locked --force --path ./cli
cargo prove install-toolchain
working-directory: ${{ github.workspace }}
test-recursion-circuit:
name: Test recursion circuit
runs-on: warp-ubuntu-latest-x64-32x
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- name: Setup CI
uses: ./.github/actions/setup
with:
pull_token: ${{ secrets.PRIVATE_PULL_TOEKN }}
- name: Run cargo test on the recursion circuit
run: |
cargo nextest run --cargo-profile dev-ci --profile ci -p sphinx-recursion-circuit
clippy:
runs-on: warp-ubuntu-latest-x64-16x
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- name: Setup CI
uses: ./.github/actions/setup
with:
pull_token: ${{ secrets.REPO_TOKEN }}
- name: Check Rustfmt Code Style
run: cargo fmt --all --check
- name: check *everything* compiles
run: cargo check --all-targets --all-features --all --examples --tests --benches
# See '.cargo/config' for list of enabled/disabled clippy lints
- name: Check clippy warnings
run: cargo xclippy -D warnings
- name: Doctests
run: cargo test --doc --workspace
- name: Cargo-deny
uses: EmbarkStudios/cargo-deny-action@v1
integration-tests-examples:
name: Build integration tests and examples
runs-on: warp-ubuntu-latest-x64-32x
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- name: Setup CI
uses: ./.github/actions/setup
with:
pull_token: ${{ secrets.REPO_TOKEN }}
perf: false
- name: Install `cargo prove` CLI
run: |
cargo install --locked --force --path ./cli
cargo prove install-toolchain
working-directory: ${{ github.workspace }}
- name: Check examples
run: |
for i in $(find ./ -maxdepth 1 -mindepth 1 -type d); do
cd "$i/script"
cargo check
cd ../../
done
working-directory: ${{ github.workspace }}/examples
- name: Check integration tests
run: |
for i in $(find ./ -maxdepth 1 -mindepth 1 -type d); do
cd "$i"
cargo check
cd ../
done
working-directory: ${{ github.workspace }}/tests
- name: Run cargo prove new
run: |
cargo prove new cargo-prove-test
cd cargo-prove-test/program
cat << EOF | tee -a Cargo.toml
[patch.'ssh://git@github.com/lurk-lab/sphinx.git']
sphinx-zkvm = { path = "../../zkvm/entrypoint" }
EOF
cd ../..
cd cargo-prove-test/script
cat << EOF | tee -a Cargo.toml
[patch.'ssh://git@github.com/lurk-lab/sphinx.git']
sphinx-sdk = { path = "../../sdk" }
sphinx-helper = { path = "../../helper" }
EOF
cargo run --release
mac-m1:
name: CI Tests on OSX ARM
runs-on: warp-macos-latest-arm64-6x
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- name: Setup CI
uses: ./.github/actions/setup
with:
pull_token: ${{ secrets.REPO_TOKEN }}
- name: Install `cargo prove` CLI
run: |
cargo install --locked --force --path ./cli
cargo prove install-toolchain
working-directory: ${{ github.workspace }}
- name: Run cargo test on sphinx except the prove_sp1 recursion test
run: |
cargo nextest run --cargo-profile dev-ci --profile ci -E 'all() - test(test_e2e_prove_groth16)'
- name: Run cargo test with no default features
run: |
cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features debug -- cpu::trace::tests::generate_trace
- name: check examples compile
run: |
for i in $(find ./ -maxdepth 1 -mindepth 1 -type d); do
cd "$i/script"
cargo check
cd ../../
done
working-directory: ${{ github.workspace }}/examples
- name: Set env
if: failure()
run: |
echo "WORKFLOW_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | tee -a $GITHUB_ENV
- name: Open an issue on failure
if: failure()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_COMMIT: ${{ github.sha }}
WORKFLOW_URL: ${{ env.WORKFLOW_URL }}
with:
filename: .github/templates/M1_MAC.md
check-aptos-lc-compiles:
runs-on: warp-ubuntu-latest-x64-16x
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
path: ci-workflows
- uses: ./ci-workflows/.github/actions/ci-env
- uses: ./ci-workflows/.github/actions/install-deps
with:
packages: "pkg-config libudev-dev"
- name: Set env
run: |
echo "DOWNSTREAM_REPO=$(echo "wormhole-foundation/example-zk-light-clients-internal" | awk -F'/' '{ print $2 }')" | tee -a $GITHUB_ENV
echo "UPSTREAM_REPO=$(echo "lurk-lab/sphinx" | awk -F'/' '{ print $2 }')" | tee -a $GITHUB_ENV
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/${{ env.UPSTREAM_REPO }}
submodules: recursive
- name: Setup CI
uses: ./sphinx/.github/actions/setup
with:
pull_token: ${{ secrets.REPO_TOKEN }}
perf: false
- name: Install cargo prove
run: |
cargo install --locked --path ./cli
cargo prove install-toolchain
working-directory: ${{ github.workspace }}/${{ env.UPSTREAM_REPO }}
- uses: actions/checkout@v4
with:
repository: "wormhole-foundation/${{ env.DOWNSTREAM_REPO }}"
path: ${{ github.workspace }}/${{ env.DOWNSTREAM_REPO }}
token: ${{ secrets.REPO_TOKEN }}
submodules: recursive
- uses: ./ci-workflows/.github/actions/check-downstream-compiles
with:
upstream-path: "${{ env.UPSTREAM_REPO }}"
downstream-path: "${{ env.DOWNSTREAM_REPO }}/aptos"
patch-ssh: true