Skip to content

Nightly tests with the code coverage #115

Nightly tests with the code coverage

Nightly tests with the code coverage #115

Workflow file for this run

#
# This workflow is triggered by scheduler or on-demand to run all the tests with the code coverage enabled and using the self-hosted GitHub runner.
# Test coverage report is attached to the current job execution results in a form of Zip archive.
#
name: Nightly tests with the code coverage
on:
schedule:
- cron: "0 0 * * *" # every day at midnight
workflow_dispatch: {}
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_tests:
name: Run all tests with the code coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust_toolchain_version: ["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: ["hetzner-1"]
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: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
with:
ocaml_version: ${{ matrix.ocaml_version }}
- name: Install test dependencies
run: |
make install-test-deps
- name: Run all tests with the code coverage
run: |
eval $(opam env)
make clean
make nextest-all-with-coverage
make test-doc-with-coverage
make generate-test-coverage-report
- name: Use shared code coverage summary
uses: ./.github/actions/coverage-summary-shared
- name: Upload the HTML test coverage report
uses: actions/upload-artifact@v4
continue-on-error: true
if: always()
with:
if-no-files-found: ignore
name: test-coverage-html-report-${{ matrix.rust_toolchain_version }}-${{ matrix.os }}
path: target/coverage/
retention-days: 30