From 837f63ba46c4662d8c3977b16e1960b06a5f70ec Mon Sep 17 00:00:00 2001 From: Ashley Williams Date: Fri, 16 Dec 2022 07:31:03 -0600 Subject: [PATCH] feat(infra): add rust clippy, fmt, tests github action --- .github/workflows/ci.yml | 58 +++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbfe79f..5c6e9a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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