feat(infra): add rust clippy, fmt, tests github action

This commit is contained in:
Ashley Williams 2022-12-16 07:31:03 -06:00
parent 8910909cf6
commit 837f63ba46
1 changed files with 36 additions and 22 deletions

View File

@ -1,33 +1,47 @@
name: Continuous Integration
name: Rust tests, clippy, style
on:
push:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 0 1,15 * *"
- cron: '11 7 * * 1,4'
env:
RUSTFLAGS: -Dwarnings
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run cargo fmt
run: |
cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run cargo clippy
run: |
cargo clippy --workspace --tests --examples
docs:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- name: Run cargo clippy
run: |
cargo doc --workspace --no-deps
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, beta, nightly]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v1
- name: Run tests
run: cargo test --all-features
clippy:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
components: clippy
- uses: actions/checkout@v1
- name: Clippy
run: cargo clippy -- -D warnings
- uses: actions/checkout@v2
- name: Run cargo test
run: |
cargo test --workspace