feat: aps layer #87
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: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 6 * * 1-5' # run once per day Monday-Friday at 6:00am | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_TERM_COLOR: always | |
CARGO_TERM_VERBOSE: 'true' | |
RUSTFLAGS: -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort | |
RUSTDOCFLAGS: -Cpanic=abort | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
# - stable | |
- nightly | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# - name: Check semver | |
# uses: obi1kenobi/cargo-semver-checks-action@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
components: llvm-tools-preview | |
- name: Download & Install grcov | |
run: | | |
mkdir -p "${HOME}/.local/bin" | |
curl -sL https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin" | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Setup LCOV | |
uses: hrishikesh-kadam/setup-lcov@v1 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-dependencies | |
with: | |
path: | | |
~/.cargo/.crates.toml | |
~/.cargo/.crates2.json | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
target | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: '-Cinstrument-coverage' | |
LLVM_PROFILE_FILE: 'cargo-test-%p-%m.profraw' | |
run: cargo test | |
- name: Coverage | |
run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage | |
- name: Report code coverage | |
uses: zgosalvez/github-actions-report-lcov@v3 | |
with: | |
coverage-files: ./target/debug/coverage | |
minimum-coverage: 90 | |
artifact-name: code-coverage-report | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
update-comment: true | |