Skip to content

Commit 98e93e3

Browse files
committed
ci: add Lint and Test
1 parent e6231d9 commit 98e93e3

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
fmt:
12+
name: rustfmt
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions-rust-lang/setup-rust-toolchain@v1
17+
with:
18+
toolchain: stable
19+
components: rustfmt
20+
- run: cargo fmt --all -- --check
21+
22+
clippy:
23+
name: clippy
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: stable
30+
components: clippy
31+
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
test:
12+
name: test ${{ matrix.toolchain }} (${{ matrix.target }})
13+
runs-on: ${{ matrix.runner }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
toolchain: [1.90.0, stable]
18+
include:
19+
- runner: ubuntu-latest
20+
target: x86_64-unknown-linux-gnu
21+
- runner: ubuntu-24.04-arm
22+
target: aarch64-unknown-linux-gnu
23+
- runner: macos-15-intel
24+
target: x86_64-apple-darwin
25+
- runner: macos-latest
26+
target: aarch64-apple-darwin
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions-rust-lang/setup-rust-toolchain@v1
30+
with:
31+
toolchain: ${{ matrix.toolchain }}
32+
target: ${{ matrix.target }}
33+
- run: cargo test --workspace --all-targets --all-features --target ${{ matrix.target }}

0 commit comments

Comments
 (0)