name: build
on:
pull_request:
push:
branches:
- main
- develop
env:
CARGO_TERM_COLOR: always
CODECOV_TOKEN: ${{ secrets.CODECOV }}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Lint
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate coverage file
run: |
cargo install cargo-tarpaulin --vers "^0.13"
cargo tarpaulin --out Xml --verbose
- name: Upload to Codecov
uses: codecov/codecov-action@v1
with:
file: cobertura.xml