name: CI
on:
schedule:
- cron: '0 2 * * *' push:
branches: [ "*" ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
rust: [nightly, stable]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Restore cargo cache
uses: actions/cache@v2
env:
cache-name: ci
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
key: ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
profile: minimal
components: rustfmt, clippy
- name: fmt
run: cargo fmt -- --check
- name: check
run: cargo check
- name: build
run: cargo build
- name: clippy
run: |
cargo clean -p fb
cargo clippy
- name: tests
run: cargo test