Skip to content

Commit e8c7e0c

Browse files
committed
added clippy, format and test gh actions
1 parent 5d2048a commit e8c7e0c

File tree

5 files changed

+57
-1
lines changed

5 files changed

+57
-1
lines changed

.github/workflows/build.yml

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
with:
3939
toolchain: stable
4040
targets: ${{ matrix.target }}
41-
components: rustfmt, clippy
4241

4342
- name: Cache cargo files
4443
uses: actions/cache@v4

.github/workflows/cargo.yml

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ env:
1414
CARGO_TERM_COLOR: always
1515

1616
jobs:
17+
test:
18+
uses: ./.github/workflows/test.yml
19+
secrets: inherit
20+
clippy:
21+
uses: ./.github/workflows/clippy.yml
22+
secrets: inherit
23+
format:
24+
uses: ./.github/workflows/format.yml
25+
secrets: inherit
1726
build:
27+
needs: [test, clippy, format]
1828
uses: ./.github/workflows/build.yml
1929
secrets: inherit

.github/workflows/clippy.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on: workflow_call
2+
3+
jobs:
4+
clippy:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
9+
- name: Set up Rust toolchain
10+
uses: dtolnay/rust-toolchain@stable
11+
with:
12+
toolchain: stable
13+
components: clippy
14+
15+
- name: Run clippy check
16+
run: cargo clippy --all-features --all-targets -- -D warnings

.github/workflows/format.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on: workflow_call
2+
3+
jobs:
4+
clippy:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
9+
- name: Set up Rust toolchain
10+
uses: dtolnay/rust-toolchain@stable
11+
with:
12+
toolchain: stable
13+
components: rustfmt
14+
15+
- name: Run rustfmt check
16+
run: cargo fmt --all -- --check

.github/workflows/test.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on: workflow_call
2+
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
9+
- name: Set up Rust toolchain
10+
uses: dtolnay/rust-toolchain@stable
11+
with:
12+
toolchain: stable
13+
14+
- name: Test with cargo test
15+
run: cargo test

0 commit comments

Comments
 (0)