From 7df0b93e5d27efa88300a460f0de88ad29887d26 Mon Sep 17 00:00:00 2001 From: Maksym Bilan Date: Mon, 15 Sep 2025 12:47:27 +0300 Subject: [PATCH] ci: build and test Rust crate on PRs Ensure PRs compile and pass tests using stable toolchain, with caching. --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 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..747862f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: Build and Test + +on: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + rust: + name: cargo build and test + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + - name: Build + run: cargo build --locked --all-targets + + - name: Test + run: cargo test --locked --all-features --no-fail-fast