Skip to content

Commit 5f40208

Browse files
authored
ci: add rust.yml
1 parent e5111fd commit 5f40208

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/rust.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: run tests
15+
strategy:
16+
matrix:
17+
platform: [ubuntu-latest, macos-latest, windows-latest]
18+
toolchain: [stable, 1.75.0]
19+
runs-on: ${{ matrix.platform }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: dtolnay/rust-toolchain@master
23+
with:
24+
toolchain: ${{ matrix.toolchain }}
25+
- name: Build
26+
run: cargo build --verbose
27+
- name: Run tests
28+
run: cargo test --verbose
29+
30+
clippy:
31+
name: run clippy lints
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: dtolnay/rust-toolchain@master
36+
with:
37+
toolchain: stable
38+
components: clippy
39+
- name: run clippy lints
40+
run: cargo clippy
41+
42+
fmt:
43+
name: run rustfmt
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: dtolnay/rust-toolchain@master
48+
with:
49+
toolchain: stable
50+
components: rustfmt
51+
- name: run rustfmt
52+
run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)