forked from powdr-labs/powdr
-
Notifications
You must be signed in to change notification settings - Fork 0
214 lines (202 loc) · 7.95 KB
/
pr-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
name: PR tests
on:
workflow_dispatch:
pull_request:
merge_group:
push:
branches:
- main
# cancel any previous running workflows for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CARGO_TERM_COLOR: always
POWDR_GENERATE_PROOFS: "true"
MAX_DEGREE_LOG: "20"
jobs:
build:
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: ⚡ Restore rust cache
id: cache
uses: buildjet/cache/restore@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
Cargo.lock
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-pr-tests-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
- name: Install EStarkPolygon prover dependencies
run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm
- name: Lint no default features
run: cargo clippy --all --all-targets --no-default-features --profile pr-tests -- -D warnings
- name: Lint all features
run: cargo clippy --all --all-targets --all-features --profile pr-tests -- -D warnings
- name: Format
run: cargo fmt --all --check --verbose
- name: Build
run: cargo build --all-targets --all --all-features --profile pr-tests
- uses: taiki-e/install-action@nextest
- name: Archive EStarkPolygon prover built dependencies
run: tar --zstd -cf pil-stark-prover-deps.tar.zst target/pr-tests/build/pil-stark-prover-*/out
- name: Create tests archive
run: cargo nextest archive --archive-file tests.tar.zst --cargo-profile pr-tests --workspace --all-features
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: tests_archive
path: |
tests.tar.zst
pil-stark-prover-deps.tar.zst
test_quick:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "1"
- "2"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: tests_archive
- name: ⚡ Cache nodejs
uses: actions/cache@v4
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
- name: Install nightly
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
- name: Install stdlib
run: rustup component add rust-src --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu
- name: Install pilcom
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
- uses: taiki-e/install-action@nextest
- name: Run default tests
run: cargo nextest run --archive-file tests.tar.zst --workspace-remap . --verbose --partition count:"${{ matrix.test }}"/2
env:
PILCOM: ${{ github.workspace }}/pilcom/
POWDR_STD: ${{ github.workspace }}/std/
run_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: ⚡ Restore rust cache
id: cache
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
Cargo.lock
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-pr-tests-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
- name: Run examples
run: cargo run --example hello_world
test_estark_polygon:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: tests_archive
- name: ⚡ Cache nodejs
uses: actions/cache@v4
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
- name: Install nightly
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
- name: Install stdlib
run: rustup component add rust-src --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu
- name: Install pilcom
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
- name: Install EStarkPolygon prover system dependency
run: sudo apt-get install -y nlohmann-json3-dev
- uses: taiki-e/install-action@nextest
- name: Unpack EStarkPolygon built dependencies
run: tar --zstd -xf pil-stark-prover-deps.tar.zst
- name: Run EStark Polygon test
run: cargo nextest run --archive-file tests.tar.zst --workspace-remap . --verbose --run-ignored=ignored-only --no-capture -E "test(=vec_median_estark_polygon)"
env:
PILCOM: ${{ github.workspace }}/pilcom/
POWDR_STD: ${{ github.workspace }}/std/
test_slow:
strategy:
matrix:
test:
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
- "7"
- "8"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: tests_archive
- name: ⚡ Cache nodejs
uses: actions/cache@v4
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
- name: Install test dependencies
run: sudo apt-get install -y binutils-riscv64-unknown-elf lld
- name: Install nightly
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
- name: Install stdlib
run: rustup component add rust-src --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu
- name: Install pilcom
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
- uses: taiki-e/install-action@nextest
- name: Run slow tests
# Number threads is set to 2 because the runner does not have enough memory for more.
run: |
NIGHTLY_TESTS=$(cat .github/workflows/nightly_tests_list.txt)
cargo nextest run --archive-file tests.tar.zst --workspace-remap . --verbose --run-ignored=ignored-only -E "!($NIGHTLY_TESTS)" --test-threads 2 --partition hash:"${{ matrix.test }}"/8
shell: bash
env:
PILCOM: ${{ github.workspace }}/pilcom/
POWDR_STD: ${{ github.workspace }}/std/