Arrabiata - first big PR #7800
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
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 | |
RUST_MIN_STACK: 31457280 | |
# 30 MB of stack for Keccak tests | |
jobs: | |
run_mdbook: | |
name: Building MDBook | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust_toolchain_version: ["1.72"] | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4.1.1 | |
- name: Setup Rust toolchain ${{ matrix.rust_toolchain_version }} | |
run: | |
| | |
curl --proto '=https' --tlsv1.2 -sSf -o rustup-init \ | |
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init | |
chmod +x ./rustup-init | |
./rustup-init -y --default-toolchain "${{ matrix.rust_toolchain_version }}" --profile default | |
rm ./rustup-init | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
# overwriting default rust-toolchain | |
echo ${{ matrix.rust_toolchain_version }} > rust-toolchain | |
- 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 PR | |
uses: actions/checkout@v4.1.1 | |
- name: Setup Rust toolchain ${{ matrix.rust_toolchain_version }} | |
run: | |
| | |
curl --proto '=https' --tlsv1.2 -sSf -o rustup-init \ | |
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init | |
chmod +x ./rustup-init | |
./rustup-init -y --default-toolchain "${{ matrix.rust_toolchain_version }}" --profile default | |
rm ./rustup-init | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
# overwriting default rust-toolchain | |
echo ${{ matrix.rust_toolchain_version }} > rust-toolchain | |
- name: Run cargo fmt | |
run: | | |
cargo fmt -- --check | |
# We run only one of the matrix options on the toffee hetzner-1, | |
# and also only in this configuration we enable heavy tests. | |
run-checks-setup: | |
runs-on: ubuntu-latest | |
outputs: | |
runners: '{"1.71":"ubuntu-latest", "1.72": "ubuntu-latest", "1.73": "ubuntu-latest", "1.74": "hetzner-1"}' | |
steps: | |
- run: echo no-op | |
run_checks: | |
needs: [run-checks-setup] | |
strategy: | |
matrix: | |
# FIXME: use the latest version of cargo nextest when we get rid of 1.71 | |
# and 1.72 | |
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"] | |
# See run-checks-setup | |
runs-on: ${{ fromJSON(needs.run-checks-setup.outputs.runners)[matrix.rust_toolchain_version] }} | |
name: Run some basic checks and tests | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4.1.1 | |
# as action-rs does not seem to be maintained anymore, building from | |
# scratch the environment using rustup | |
- name: Setup Rust toolchain ${{ matrix.rust_toolchain_version }} | |
run: | |
| | |
curl --proto '=https' --tlsv1.2 -sSf -o rustup-init \ | |
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init | |
chmod +x ./rustup-init | |
./rustup-init -y --default-toolchain "${{ matrix.rust_toolchain_version }}" --profile default | |
rm ./rustup-init | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
# overwriting default rust-toolchain | |
echo ${{ matrix.rust_toolchain_version }} > rust-toolchain | |
- name: Setup OCaml ${{ matrix.ocaml_version }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml_version }} | |
# https://github.com/ocaml/setup-ocaml/issues/211#issuecomment-1058882386 | |
# disable-cache: true | |
- name: Install markdownlint | |
run: | | |
# FIXME: 0.39.0 makes the CI fail | |
npm install -g markdownlint-cli@0.38.0 | |
# | |
# 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) | |
RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps | |
# | |
# Coding guidelines | |
# | |
- name: Lint (clippy) | |
run: | | |
eval $(opam env) | |
cargo clippy --all-features --all-targets --tests -- -W clippy::all -D warnings | |
# | |
# Build | |
# | |
- name: Ensure that everything builds | |
run: | | |
eval $(opam env) | |
cargo build --release --all-targets --all-features | |
# | |
# Tests | |
# | |
# https://nexte.st/book/pre-built-binaries.html#using-nextest-in-github-actions | |
- name: Install nextest 0.9.67 | |
run: | | |
eval $(opam env) | |
# FIXME: update to 0.9.68 when we get rid of 1.71 and 1.72. | |
cargo install cargo-nextest@=0.9.67 --locked | |
- name: Run non-heavy tests | |
run: | | |
eval $(opam env) | |
cargo nextest run --all-features --release --profile ci -E "not test(heavy)" | |
- name: Run heavy tests | |
if: ${{ matrix.rust_toolchain_version == '1.74' }} | |
run: | | |
eval $(opam env) | |
cargo nextest run --all-features --release --profile ci -E "test(heavy)" | |
- name: Doc tests | |
run: | | |
eval $(opam env) | |
cargo test --all-features --release --doc |