From a81dff414c103f89162039585c915432473524a6 Mon Sep 17 00:00:00 2001 From: Rob Wagner Date: Mon, 13 May 2024 18:40:02 -0400 Subject: [PATCH] Add ci workflow --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 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..240b5f9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: ci + +env: + CARGO_TERM_COLOR: always + +on: + push: + branches: + - main + pull_request: {} + +jobs: + check: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - beta + - nightly + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - name: run clippy + run: cargo clippy --all-features -- -D warnings + - name: run formatter checks + run: cargo fmt --all --check + + test: + needs: check + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - beta + - nightly + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + - uses: Swatinem/rust-cache@v2 + - name: run tests + run: cargo test --all-features