From c7f8f4553b8fd30b0b606fbbbd73ccc4e84ee8a4 Mon Sep 17 00:00:00 2001 From: Vitaly Slobodin Date: Wed, 7 May 2025 22:50:46 +0200 Subject: [PATCH] Add GitHub workflow for running linters and tests --- .config/nextest.toml | 3 ++ .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .config/nextest.toml create mode 100644 .github/workflows/ci.yml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000..18e4061 --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,3 @@ +[profile.ci] +# Don't fail fast in CI to run the full test suite. +fail-fast = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..054fdbc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +--- +on: + push: + branches: [main] + pull_request: + branches: + - main + +name: CI + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v4 + with: + # By default actions/checkout checks out a merge commit. Check out the PR head instead. + # https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + target: wasm32-wasip1 + override: true + components: rustfmt, clippy + - name: Lint (clippy) + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-features --all-targets + - name: Rustfmt Check + uses: actions-rust-lang/rustfmt@v1 + + build: + name: Build and test + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.86 + target: wasm32-wasip1 + override: true + - name: Build extension + uses: actions-rs/cargo@v1 + with: + command: build + args: --target wasm32-wasip1 --all-features + - name: Install latest nextest release + uses: taiki-e/install-action@nextest + - name: Test with latest nextest release + uses: actions-rs/cargo@v1 + with: + command: nextest + args: run --all-features --profile ci