From 4ede8824c06841fbf0907726f2eda3de7efacde6 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 4 Aug 2023 11:03:04 -0500 Subject: [PATCH] Add a CI workflow --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d95c023 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI +on: + pull_request: + push: + branches: + - master + +jobs: + check-msrv: + name: Check + strategy: + matrix: + toolchain: + - "1.65" + - stable + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain}} + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo check + run: cargo check + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo test + run: cargo test --workspace + + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo fmt + run: cargo fmt --all --check + + - name: Run cargo clippy + run: cargo clippy --workspace --all-targets -- -D warnings + + - name: Run cargo doc + run: cargo doc --no-deps --workspace --document-private-items + env: + RUSTDOCFLAGS: -D warnings