Skip to content

CI

CI #235

Workflow file for this run

name: CI
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [master]
schedule:
# additionally run once per week (At 00:00 on Sunday) to maintain cache
- cron: '0 0 * * 0'
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
- name: Build
run: cargo build --verbose
- name: Unit tests
run: cargo test --verbose
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
override: true
- name: Check formatting
run: |
cargo fmt --all -- --check
clippy_check:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cargo
uses: dtolnay/rust-toolchain@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
toolchain: stable
components: clippy
override: true
- name: Cargo clippy
run: |
cargo clippy --all-features