name: Rust CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Test with all features
run: cargo test --verbose --all-features
- name: Test with all verbose feature
run: cargo test --verbose --features verbose
- name: Install llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
- name: Install nextest
uses: taiki-e/install-action@nextest
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
- name: Collect coverage data (including ignored tests)
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
run: cargo llvm-cov nextest --lcov --output-path lcov.info
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true