File tree Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 20
20
run : rustup update stable
21
21
- name : Install cargo-llvm-cov
22
22
uses : taiki-e/install-action@cargo-llvm-cov
23
+ - name : Install Clippy
24
+ run : rustup component add clippy
25
+ - name : Install cargo-sonar and run Clippy
26
+ run : |
27
+ cargo install cargo-sonar
28
+ cargo clippy --message-format json > my-clippy-report.json
29
+ cargo sonar --clippy --clippy-path my-clippy-report.json
23
30
- name : Generate code coverage
24
31
run : >
25
32
cargo llvm-cov
31
38
uses : actions/upload-artifact@v4
32
39
with :
33
40
name : coverage-report
34
- path : lcov.info
41
+ path : |
42
+ lcov.info
43
+ sonar-issues.json
35
44
36
45
codecov :
37
46
name : Upload to Codecov
54
63
files : coverage.out
55
64
token : ${{ secrets.CODECOV_TOKEN }} # required
56
65
verbose : true # optional (default = false)
66
+
67
+ sonarqube :
68
+ name : SonarQube
69
+ runs-on : ubuntu-latest
70
+ steps :
71
+ - name : Checkout repository
72
+ uses : actions/checkout@v5
73
+ with :
74
+ fetch-depth : 0
75
+ - name : Download coverage artifact
76
+ uses : actions/download-artifact@v5
77
+ with :
78
+ name : coverage-report
79
+ - name : SonarCloud Scan
80
+ uses : SonarSource/sonarqube-scan-action@master
81
+ env :
82
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
83
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
84
+ with :
85
+ args : >
86
+ -Dsonar.externalIssuesReportPaths=sonar-issues.json
87
+ -Dcommunity.rust.lcov.reportPaths=lcov.info
Original file line number Diff line number Diff line change
1
+ sonar.projectKey =sir-gon_algorithm-exercises-rust
2
+ sonar.organization =sir-gon
3
+
4
+
5
+ # This is the name and version displayed in the SonarCloud UI.
6
+ # sonar.projectName=algorithm-exercises-rust
7
+ # sonar.projectVersion=1.0
8
+
9
+
10
+ # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
11
+ # sonar.sources=.
12
+
13
+ # Encoding of the source code. Default is default system encoding
14
+ # sonar.sourceEncoding=UTF-8
You can’t perform that action at this time.
0 commit comments