name: CI
on: [push, pull_request]
jobs:
Test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta]
exclude:
- os: macos-latest
rust: beta
- os: windows-latest
rust: beta
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: build
- uses: actions-rs/cargo@v1
with:
command: test
args: --lib
- name: Generate Coverage
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
- name: Upload Coverage
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
with:
fail_ci_if_error: true