File tree Expand file tree Collapse file tree 1 file changed +38
-3
lines changed Expand file tree Collapse file tree 1 file changed +38
-3
lines changed Original file line number Diff line number Diff line change 15
15
16
16
jobs :
17
17
18
- coverage :
18
+ build-and-test :
19
19
name : " Go CI Tests Coverage"
20
20
strategy :
21
21
fail-fast : false
@@ -41,21 +41,56 @@ jobs:
41
41
run : >
42
42
go test -v
43
43
-covermode=atomic
44
+ -coverpkg=./...
44
45
-coverprofile="coverage.out"
45
46
./exercises/...
46
47
47
48
- name : Coverage
48
49
run : go tool cover -func="coverage.out"
49
50
51
+ - name : Upload coverage artifact
52
+ uses : actions/upload-artifact@v4
53
+ with :
54
+ name : coverage-report
55
+ path : coverage.out
56
+
57
+ codecov :
58
+ name : Upload to Codecov
59
+ runs-on : ubuntu-24.04
60
+ needs : build-and-test
61
+
62
+ steps :
63
+ - name : Download coverage artifact
64
+ uses : actions/download-artifact@v5
65
+ with :
66
+ name : coverage-report
67
+
50
68
- name : Upload coverage reports to Codecov with GitHub Action
51
69
uses : codecov/codecov-action@v5
52
70
with :
71
+ files : coverage/coverage.out
53
72
token : ${{ secrets.CODECOV_TOKEN }} # required
54
73
verbose : true # optional (default = false)
55
74
56
- - name : Analyze with SonarCloud
75
+ sonarqube :
76
+ name : Analyze with SonarQube
77
+ runs-on : ubuntu-24.04
78
+ needs : build-and-test
79
+
80
+ steps :
81
+ - name : Checkout repository
82
+ uses : actions/checkout@v5
83
+ with :
84
+ fetch-depth : 0
85
+
86
+ - name : Download coverage artifact
87
+ uses : actions/download-artifact@v5
88
+ with :
89
+ name : coverage-report
90
+ path : coverage
91
+
92
+ - name : SonarQube Scan
57
93
uses : SonarSource/sonarqube-scan-action@master
58
94
env :
59
95
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
60
- # Needed to get PR information, if any
61
96
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments