switch to llvm-cov #121
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: Continous integration | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
toolchain: stable | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
toolchain: nightly | ||
- os: ubuntu-22.04 | ||
target: x86_64-unknown-linux-gnu | ||
toolchain: stable | ||
#- os: macos-12 | ||
#target: x86_64-apple-darwin | ||
#toolchain: stable | ||
# TODO: also aarch64 / M1 | ||
- os: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
toolchain: stable | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
toolchain: beta | ||
# Test both windows-gnu and windows-msvc; use beta rust on one | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
target: ${{ matrix.target }} | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
- run: ${{ matrix.deps }} | ||
- name: Cache cargo plugins | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/bin/ | ||
key: ${{ runner.os }}-cargo-plugins | ||
- if: startsWith(matrix.toolchain, 'nightly') == false | ||
name: Install fmt | ||
run: | | ||
rustup component add rustfmt | ||
- if: startsWith(matrix.toolchain, 'nightly') == false | ||
name: Check fmt | ||
run: | | ||
cargo fmt -- --check | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose -- --nocapture | ||
- name: store artifact image | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tester-artifact.png | ||
path: "examples/example_experiment_*" | ||
- name: store artifact diff image | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tester-artifact.png | ||
path: "diff.png" | ||
- name: Run doc | ||
run: cargo doc --verbose | ||
- if: startsWith(matrix.os, 'ubuntu') | ||
name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- if: startsWith(matrix.os, 'ubuntu') | ||
name: Generate code coverage | ||
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | ||
- if: startsWith(matrix.os, 'ubuntu') | ||
name: Upload to codecov.io | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
fail_ci_if_error: true |