name: CI
on:
pull_request: {}
push:
branches: main
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.46.0 - stable
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
- run: cargo check
- run: cargo test --no-default-features --release
- run: cargo test --release
- run: cargo test --all-features --release
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
profile: minimal
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.46.0 components: clippy
override: true
profile: minimal
- run: cargo clippy --all-features -- -D warnings
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: actions-rs/tarpaulin@v0.1
with:
version: 'latest'
args: --all -- --test-threads 1
- uses: codecov/codecov-action@v1
- uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml