Skip to content

Commit 3e6d60f

Browse files
committed
Configuring sonar
1 parent a1f07c1 commit 3e6d60f

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

.github/workflows/scan.yml

+53-3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,56 @@ jobs:
4949
# with:
5050
# sarif_file: trivy-results.sarif
5151

52+
llvm-cov:
53+
name: RustAnalize
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@v4
58+
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+
67+
- name: Install cargo-llvm-cov
68+
uses: taiki-e/install-action@cargo-llvm-cov
69+
70+
- name: Install Clippy
71+
run: rustup component add clippy
72+
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+
98+
- name: Generate code coverage
99+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
100+
101+
52102
codeql:
53103
name: RustAnalize
54104
runs-on: ubuntu-latest
@@ -95,15 +145,15 @@ jobs:
95145
restore-keys: |
96146
${{ runner.os }}-cargo-target-
97147
148+
- name: Generate code coverage
149+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
150+
98151
- name: Install cargo-sonar and run Clippy
99152
run: |
100153
cargo install cargo-sonar
101154
cargo clippy --message-format json > my-clippy-report.json
102155
cargo sonar --clippy-path my-clippy-report.json
103156
104-
- name: Generate code coverage
105-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
106-
107157
- name: SonarQube Scan
108158
uses: SonarSource/sonarqube-scan-action@v4
109159
env:

0 commit comments

Comments
 (0)