From efaf62803344795355bbc11d15eb568afa2d67ce Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 7 Nov 2022 19:13:48 +0100 Subject: [PATCH] Add GitHub Actions configuration (#13) This is a minimal setup that checks code formatting, clippy lints (also a `check`), documentation and specifically broken intradoc links and directives, and the current MSRV of 1.58.1. --- .github/workflows/ci.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 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..2c5a1aa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +on: [push, pull_request] + +name: CI + +jobs: + clippy: + name: Clippy + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --workspace --all-targets -- -D warnings + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + doc: + name: Build documentation + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: -Dwarnings + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Build documentation + uses: actions-rs/cargo@v1 + with: + command: doc + args: --no-deps --workspace --all-features --document-private-items + + check_msrv: + name: Check MSRV (1.58.1) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: dtolnay/rust-toolchain@1.58.1 + - uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets --all-features