name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [nightly]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.version }}
override: true
components: rustfmt, llvm-tools-preview
- name: Cache things installed with cargo
id: cache-cargo-bin
uses: actions/cache@v1
with:
path: ~/.cargo/bin/
key: ${{ runner.os }}-cargo-bin-grcov
- name: Install grcov
if: steps.cache-cargo-bin.outputs.cache-hit != 'true'
run: cargo install grcov
- name: Clean
run: cargo clean
- name: Build
run: cargo build --verbose
env:
RUSTFLAGS: -Zinstrument-coverage
- name: Test
run: cargo test
env:
RUSTFLAGS: -Zinstrument-coverage
LLVM_PROFILE_FILE: sectok-%p-%m.profraw
- name: Enforce formatting
run: cargo fmt -- --check
- name: Generate code coverage
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- uses: codecov/codecov-action@v1
with:
verbose: true