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