Skip to content

ci: update github action #39

ci: update github action

ci: update github action #39

Workflow file for this run

on:
push:
# Run on the main branch
branches:
- main
pull_request:
branches:
- main
name: ci
jobs:
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --all -- --check
check:
runs-on: ${{ matrix.os }}
needs:
- format
strategy:
matrix:
os:
- ubuntu-22.04
- macos-12
- windows-2019
toolchain:
- stable
- 1.70.0 # msrv (minimum supported rust version)
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ matrix.os }}-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
run: |
rustup toolchain install ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
- name: Run cargo check
run: cargo +${{ matrix.toolchain }} check
- name: Run cargo test
run: cargo +${{ matrix.toolchain }} test -- --nocapture --test-threads 1