From e3a829e9f0f8e98f0971fbb5f33220f7f94fedf1 Mon Sep 17 00:00:00 2001 From: Angel Hudgins Date: Mon, 24 Mar 2025 15:08:29 +0100 Subject: [PATCH] ci: add github actions workflow --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 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..dbcd4a8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: [push, pull_request] + +jobs: + cargo-deny: + name: cargo-deny + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: EmbarkStudios/cargo-deny-action@v2 + + fmt: + name: rustfmt / 1.85.0 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@1.85.0 + with: + components: rustfmt + + - name: Rust rustfmt + run: cargo fmt --all -- --check + + clippy: + name: clippy / 1.85.0 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@1.85.0 + with: + components: clippy + + - name: Run clippy + run: cargo clippy --all-features -- -D warnings + + test: + name: test / ${{ matrix.name }} + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - name: stable + rust: stable + - name: beta + rust: beta + - name: nightly + rust: nightly + - name: 1.83.0 + rust: 1.83.0 + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + + - name: Run tests + run: cargo test