name: Continuous integration
on:
push:
branches:
- master
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check
strategy:
fail-fast: false
matrix:
rust: [nightly, stable]
os: [ubuntu-latest, windows-latest, macos-latest]
features: ["", "color", "derive", "macros", "color,derive", "color,derive,macros"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust || 'stable' }}
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features --features=${{ matrix.features }}
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings
test:
name: Unit Test Suite
needs: [check, fmt, clippy]
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]
features: ["", "color"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --no-fail-fast --target ${{ matrix.target }} --features=${{ matrix.features }}
test_quickcheck:
name: A quickcheck test suite
needs: [check, fmt, clippy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --no-fail-fast -- --include-ignored qc_
coverage:
name: Coveralls
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: "0.15.0"
args: "--workspace --out Lcov --output-dir ./coverage --exclude-files target/* --exclude-files tabled_derive/* --exclude-files examples/*"
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}