Skip to content

Rust CI

Rust CI #81

Workflow file for this run

name: Rust CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
fail-fast: true
matrix:
# 1.67 is the MSRV for the crate
rust: ['nightly', 'beta', 'stable', '1.67']
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install ${{matrix.rust}} toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- name: Build
if: matrix.rust != 'nightly'
run: cargo build --all-targets
- name: Build with 'nightly' feature
if: matrix.rust == 'nightly'
run: cargo build --all-targets --features nightly
- name: Test
if: matrix.rust != 'nightly'
run: cargo test
- name: Test with 'nightly' feature
if: matrix.rust == 'nightly'
run: cargo test --features nightly
format:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check format
run: cargo fmt -- --check
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Lint
run: cargo clippy --all-features
miri:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- name: Run miri tests
run: cargo miri test