Skip to content

Commit c7f8f45

Browse files
committed
Add GitHub workflow for running linters and tests
1 parent c4bd1df commit c7f8f45

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.config/nextest.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[profile.ci]
2+
# Don't fail fast in CI to run the full test suite.
3+
fail-fast = false

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches:
7+
- main
8+
9+
name: CI
10+
11+
jobs:
12+
lint:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
env:
16+
RUSTFLAGS: -D warnings
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
21+
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
- uses: actions-rust-lang/setup-rust-toolchain@v1
24+
with:
25+
toolchain: stable
26+
target: wasm32-wasip1
27+
override: true
28+
components: rustfmt, clippy
29+
- name: Lint (clippy)
30+
uses: actions-rs/cargo@v1
31+
with:
32+
command: clippy
33+
args: --all-features --all-targets
34+
- name: Rustfmt Check
35+
uses: actions-rust-lang/rustfmt@v1
36+
37+
build:
38+
name: Build and test
39+
runs-on: ubuntu-latest
40+
env:
41+
RUSTFLAGS: -D warnings
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
ref: ${{ github.event.pull_request.head.sha }}
46+
- uses: actions-rust-lang/setup-rust-toolchain@v1
47+
with:
48+
toolchain: 1.86
49+
target: wasm32-wasip1
50+
override: true
51+
- name: Build extension
52+
uses: actions-rs/cargo@v1
53+
with:
54+
command: build
55+
args: --target wasm32-wasip1 --all-features
56+
- name: Install latest nextest release
57+
uses: taiki-e/install-action@nextest
58+
- name: Test with latest nextest release
59+
uses: actions-rs/cargo@v1
60+
with:
61+
command: nextest
62+
args: run --all-features --profile ci

0 commit comments

Comments
 (0)