CI #219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: ['master'] | |
schedule: | |
- cron: '36 3 * * 6' # every Saturday morning | |
env: | |
CARGO_UNSTABLE_SPARSE_REGISTRY: 'true' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
name: Test Suite | |
strategy: | |
matrix: | |
rust: | |
- nightly | |
# Check a ~3 months old nightly as "oldest supported version" | |
- nightly-2024-05-01 | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Clear lockfiles (cron jobs only) | |
if: github.event_name == 'schedule' | |
# macOS `find` requires the `.` | |
run: | | |
for C in $(find . -name Cargo.lock); do | |
echo "Updating $C" | |
cargo update --manifest-path $(dirname "$C")/Cargo.toml | |
done | |
- name: Run tests | |
working-directory: test | |
run: ./ci.sh | |
check: | |
name: Checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.75.0 | |
components: rustfmt, clippy | |
- name: rustfmt | |
run: cargo fmt --check | |
- name: clippy | |
run: cargo clippy -- -D warnings |