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: on:
push:
pull_request: pull_request:
push:
branches:
- main
schedule: schedule:
- cron: "0 0 1,15 * *" - cron: '11 7 * * 1,4'
env:
RUSTFLAGS: -Dwarnings
jobs: 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: test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macOS-latest] os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, beta, nightly]
steps: steps:
- uses: hecrj/setup-rust-action@v1 - uses: actions/checkout@v2
with: - name: Run cargo test
rust-version: ${{ matrix.rust }} run: |
- uses: actions/checkout@v1 cargo test --workspace
- 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