-
Notifications
You must be signed in to change notification settings - Fork 94
193 lines (161 loc) · 5.26 KB
/
ci.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
name: CI
on:
workflow_dispatch:
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
# https://doc.rust-lang.org/cargo/reference/profiles.html#release
RUSTFLAGS: -Coverflow-checks=y -Cdebug-assertions=y
# https://doc.rust-lang.org/cargo/reference/profiles.html#incremental
CARGO_INCREMENTAL: 1
# https://nexte.st/book/pre-built-binaries.html#using-nextest-in-github-actions
CARGO_TERM_COLOR: always
# 30 MB of stack for Keccak tests
RUST_MIN_STACK: 31457280
jobs:
run_mdbook:
name: Building MDBook
runs-on: ubuntu-latest
strategy:
matrix:
rust_toolchain_version: ["1.72"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}
- name: Build the mdbook
run: |
cd book
make deps
make build
run_formatting:
name: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
rust_toolchain_version: ["nightly"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}
- name: Run cargo fmt
run: |
make format
run_checks:
name: Run checks and tests
# We run only one of the matrix options on the toffee `hetzner-1` self-hosted GitHub runner.
# Only in this configuration we enable tests with the code coverage data gathering.
# runs-on: [hetzner-proof-systems-runners-group-1]
runs-on: ${{ matrix.rust_toolchain_version == '1.74' && 'hetzner-1' || 'ubuntu-latest' }}
env:
RUST_TOOLCHAIN_COVERAGE_VERSION: "1.74"
strategy:
matrix:
rust_toolchain_version: ["1.71", "1.72", "1.73", "1.74"]
# FIXME: currently not available for 5.0.0.
# It might be related to boxroot dependency, and we would need to bump
# up the ocaml-rs dependency
ocaml_version: ["4.14"]
node: [20]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}
- name: Apply the Rust smart cacheing
uses: Swatinem/rust-cache@v2
- name: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
with:
ocaml_version: ${{ matrix.ocaml_version }}
- name: Install markdownlint
run: |
# FIXME: 0.39.0 makes the CI fail
npm install -g [email protected]
#
# Doc & Spec
#
- name: Install cargo-spec for specifications
run: |
eval $(opam env)
cargo install --locked cargo-spec
- name: Build the kimchi specification
run: |
cd book/specifications/kimchi
make build
- name: Build the polynomial commitment specification
run: |
cd book/specifications/poly-commitment
make build
- name: Check that up-to-date specification is checked in
run: |
git diff --exit-code ":(exclude)rust-toolchain"
- name: Build cargo docs
run: |
eval $(opam env)
make generate-doc
#
# Coding guidelines
#
- name: Lint (clippy)
run: |
eval $(opam env)
make lint
#
# Build
#
- name: Ensure that everything builds
run: |
eval $(opam env)
make
#
# Tests
#
- name: Install test dependencies
run: |
make install-test-deps
- name: Doc tests
if: ${{ matrix.rust_toolchain_version != env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
run: |
eval $(opam env)
make test-doc
- name: Run non-heavy tests without the code coverage
if: ${{ matrix.rust_toolchain_version != env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
run: |
eval $(opam env)
make nextest
- name: Run non-heavy tests with the code coverage
if: ${{ matrix.rust_toolchain_version == env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
run: |
eval $(opam env)
make nextest-with-coverage
make test-doc-with-coverage
make generate-test-coverage-report
- name: Use shared code coverage summary
if: ${{ matrix.rust_toolchain_version == env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
uses: ./.github/actions/coverage-summary-shared
- name: Use shared Codecov reporting steps
if: ${{ matrix.rust_toolchain_version == env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
uses: ./.github/actions/codecov-shared
with:
token: ${{ secrets.CODECOV_TOKEN }}