Skip to content

Commit 594609c

Browse files
committed
clippy test
1 parent 853245f commit 594609c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/clippy.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Clippy Test
2+
3+
on:
4+
pull_request:
5+
6+
7+
jobs:
8+
git-diff:
9+
runs-on: ubuntu-latest
10+
name: 'Git Diff - Powered by Rust'
11+
outputs:
12+
DIFF_FILES: ${{ steps.git-diff.outputs.DIFF_FILES }}
13+
DIFF_COUNT: ${{ steps.git-diff.outputs.DIFF_COUNT }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: LuisLiraC/[email protected]
17+
id: git-diff
18+
with:
19+
patterns: '*.rs'
20+
21+
clippy-test:
22+
runs-on: ubuntu-latest
23+
needs: [git-diff]
24+
if: ${{ needs.git-diff.outputs.DIFF_COUNT != 0 }}
25+
name: Run Tests
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Cache cargo registry
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cargo/registry
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-cargo-registry-
36+
37+
- name: Cache cargo index
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.cargo/git
41+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-cargo-index-
44+
45+
- name: Cache cargo build
46+
uses: actions/cache@v4
47+
with:
48+
path: target
49+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
50+
restore-keys: |
51+
${{ runner.os }}-cargo-build-
52+
53+
- name: Run Tests
54+
run: cargo clippy --color always -- -Dwarnings -W clippy::pedantic

0 commit comments

Comments
 (0)