name: Rust CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
include:
- rust: stable
- rust: stable
features: write
- rust: beta
features: write
- rust: nightly
features: write
- rust: stable
features: default-remote
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: master
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Lint with Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features --release
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
- name: Run tests with specific features
run: cargo test --features ${{ matrix.features }}