Skip to content

CI refactoring, test coverage data gathering and reports generation. #6

CI refactoring, test coverage data gathering and reports generation.

CI refactoring, test coverage data gathering and reports generation. #6

Workflow file for this run

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 repository
uses: actions/checkout@v4.1.1
- 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.1.1
- 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 some basic checks and tests
runs-on: ${{ matrix.os }}
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"]
os: ["ubuntu-latest"]
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}
- 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 markdownlint-cli@0.38.0
# TODO: Remove debug logging
- name: Echo tollchain version and environment
run: |
echo rustc --version
echo ""
echo $GITHUB_PATH
echo ""
echo $PATH
echo ""
echo $CARGO_HOME
echo ""
env
#
# 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)
make lint
#
# Build
#
- name: Ensure that everything builds
run: |
eval $(opam env)
make
#
# Tests
#
- name: Install test dependencies
run: |
make install-test-deps
- name: Run non-heavy tests without the code coverage
if: ${{ matrix.rust_toolchain_version != env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
run: |
eval $(opam env)
make clean
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 clean
make nextest-with-coverage
- 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 }}
- name: Doc tests
run: |
eval $(opam env)
cargo test --all-features --release --doc