-
Notifications
You must be signed in to change notification settings - Fork 4
204 lines (193 loc) · 6.91 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
name: Tests
on:
push:
branches: 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: argumentcomputer/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 *all of* sphinx except the test_e2e_prove_plonk recursion test
run: |
cargo nextest run --cargo-profile dev-ci --profile ci --workspace --features "plonk" -E 'all() - test(test_e2e_prove_plonk)'
- 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" -E 'test(cpu::trace::tests)'
test-recursion-circuit:
name: Test recursion circuit
runs-on: warp-ubuntu-latest-x64-32x
steps:
- uses: actions/checkout@v4
with:
repository: argumentcomputer/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 the recursion circuit
run: |
cargo nextest run --cargo-profile dev-ci --profile ci --features "plonk" -E 'package(sphinx-recursion-circuit)'
clippy:
runs-on: warp-ubuntu-latest-x64-16x
steps:
- uses: actions/checkout@v4
with:
repository: argumentcomputer/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: argumentcomputer/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 deps
run: sudo apt update && sudo apt install cmake -y
- name: Install `cargo prove` CLI
run: |
cargo install --locked --force --path ./cli
cargo prove install-toolchain
working-directory: ${{ github.workspace }}
- name: Check examples
run: make
working-directory: ${{ github.workspace }}/examples
- name: Check integration tests
run: make
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/argumentcomputer/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/argumentcomputer/sphinx.git']
sphinx-sdk = { path = "../../sdk" }
sphinx-helper = { path = "../../helper" }
EOF
cargo run --release -- --prove
mac-m1:
name: Check OSX ARM compiles
runs-on: warp-macos-latest-arm64-6x
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
repository: argumentcomputer/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: Check workspace
run: cargo check --all-targets --all-features --workspace
- name: Check examples
run: make
working-directory: ${{ github.workspace }}/examples
- name: Check integration tests
run: make
working-directory: ${{ github.workspace }}/tests
- 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-downstream-compiles:
runs-on: warp-ubuntu-latest-x64-16x
strategy:
fail-fast: false
matrix:
include:
- repo: zk-light-clients
path: aptos
features: aptos
- repo: zk-light-clients
path: ethereum
features: ethereum
- repo: lurk
path: ""
steps:
- uses: actions/checkout@v4
with:
repository: argumentcomputer/ci-workflows
path: ci-workflows
- uses: ./ci-workflows/.github/actions/ci-env
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/sphinx
- name: Setup CI
uses: ./sphinx/.github/actions/setup
with:
pull_token: ${{ secrets.REPO_TOKEN }}
perf: false
- name: Set `zk-light-clients` env
if: ${{ matrix.repo == 'zk-light-clients' }}
run: |
sudo apt-get update && sudo apt-get install -y build-essential pkg-config libssl-dev libudev-dev cmake clang
echo "RUSTFLAGS=${{ env.RUSTFLAGS }} --cfg tokio_unstable" | tee -a $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: argumentcomputer/${{ matrix.repo }}
path: ${{ github.workspace }}/${{ matrix.repo }}
token: ${{ secrets.REPO_TOKEN }}
- uses: ./ci-workflows/.github/actions/check-downstream-compiles
with:
upstream-path: "sphinx"
downstream-path: "${{ matrix.repo }}/${{ matrix.path }}"
features: "${{ matrix.features }}"