name: build
on: [push, pull_request]
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [stable]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Cache Dependencies & Build Outputs
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy
- name: Check Code Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Code Lint
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features --workspace -- -D warnings
- name: Code Lint Without Default Features
uses: actions-rs/cargo@v1
with:
command: clippy
args: --no-default-features --workspace -- -D warnings
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --workspace
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Generate Code Coverage
uses: actions-rs/tarpaulin@v0.1
with:
args: --all-features
- name: Upload Code Coverage
uses: codecov/codecov-action@v3