Add code coverage in ci #71
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: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "*" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Plonky3 | |
uses: actions/checkout@v4 | |
with: | |
repository: Plonky3/Plonky3 | |
path: Plonky3 | |
- name: Checkout Valida | |
uses: actions/checkout@v4 | |
with: | |
path: valida | |
- name: Install nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
- name: Build | |
working-directory: valida | |
run: cargo build --all-targets | |
- name: Test | |
working-directory: valida | |
run: cargo test | |
coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
container: | |
image: xd009642/tarpaulin:develop-nightly | |
options: --security-opt seccomp=unconfined | |
steps: | |
- name: Checkout Plonky3 | |
uses: actions/checkout@v4 | |
with: | |
repository: Plonky3/Plonky3 | |
path: Plonky3 | |
- name: Checkout Valida | |
uses: actions/checkout@v4 | |
with: | |
path: valida | |
- name: Generate code coverage | |
working-directory: valida | |
run: | | |
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v2 | |
lints: | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Plonky3 | |
uses: actions/checkout@v4 | |
with: | |
repository: Plonky3/Plonky3 | |
path: Plonky3 | |
- name: Checkout Valida | |
uses: actions/checkout@v4 | |
with: | |
path: valida | |
- name: Install nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt, clippy | |
- name: Format | |
working-directory: valida | |
run: cargo fmt --all -- --check | |
# TODO: Enforce clippy at some point... | |
# - name: Run cargo clippy | |
# working-directory: valida | |
# run: cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features |