Skip to content

Commit 3e4621d

Browse files
committed
Add code quality scanning
1 parent 7e2d5b6 commit 3e4621d

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

.github/workflows/scan.yml

+34-1
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,48 @@ jobs:
5656
- name: Checkout repository
5757
uses: actions/checkout@v4
5858

59+
# Set up Rust
60+
- name: Set up Rust
61+
uses: actions-rs/toolchain@v1
62+
with:
63+
profile: minimal
64+
toolchain: nightly
65+
override: true
66+
5967
- name: Install cargo-llvm-cov
6068
uses: taiki-e/install-action@cargo-llvm-cov
6169

6270
- name: Install Clippy
6371
run: rustup component add clippy
6472

73+
# Cache Cargo dependencies
74+
- name: Cache Cargo registry
75+
uses: actions/cache@v3
76+
with:
77+
path: ~/.cargo/registry
78+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
79+
restore-keys: |
80+
${{ runner.os }}-cargo-registry-
81+
82+
- name: Cache Cargo index
83+
uses: actions/cache@v3
84+
with:
85+
path: ~/.cargo/git
86+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
87+
restore-keys: |
88+
${{ runner.os }}-cargo-index-
89+
90+
- name: Cache target directory
91+
uses: actions/cache@v3
92+
with:
93+
path: target
94+
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
95+
restore-keys: |
96+
${{ runner.os }}-cargo-target-
97+
6598
- name: Install cargo-sonar and run Clippy
6699
run: |
67-
cargo install cargo-sonar
100+
cargo install cargo-sonar
68101
cargo clippy --message-format json > my-clippy-report.json
69102
cargo sonar --issues clippy --clippy-path my-clippy-report.json
70103

0 commit comments

Comments
 (0)