Skip to content

Commit 8b7bc6f

Browse files
committed
Running code coverage tests within the Sonar CLoud Static Scan action (#93)
1 parent a210798 commit 8b7bc6f

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

.github/workflows/sonar-checks.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,30 @@ jobs:
1111
sonarcloud:
1212
name: Sonar Cloud Static Scans
1313
runs-on: ubuntu-latest
14+
env:
15+
go_version: '1.23'
16+
1417
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
1518

1619
steps:
17-
- name: Fetch Code Coverage Report
18-
uses: actions/download-artifact@v4
20+
- name: Checkout Provider
21+
uses: actions/checkout@v4
1922
with:
20-
name: coverage-report
21-
path: .
23+
fetch-depth: 0
24+
25+
- name: Setup Go ${{ env.go_version }}
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: ${{ env.go_version }}
29+
30+
- name: Run unit tests with coverage
31+
run: make testcov
32+
33+
# - name: Fetch Code Coverage Report
34+
# uses: actions/download-artifact@v4
35+
# with:
36+
# name: coverage-report
37+
# path: .
2238

2339
- name: Sonar Cloud Scan
2440
uses: SonarSource/[email protected]

.github/workflows/unit_test_and_quality.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ jobs:
3030
- name: Build the Provider
3131
run: go build -v ./...
3232

33-
- name: Run unit tests with coverage
34-
run: make testcov
33+
- name: Run Provider Unit Tests
34+
run: make test
3535

36-
- name: Upload code coverage report from unit tests
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: coverage-report
40-
path: unit-testing.cov
36+
# - name: Run unit tests with coverage
37+
# run: make testcov
38+
39+
# - name: Upload code coverage report from unit tests
40+
# uses: actions/upload-artifact@v4
41+
# with:
42+
# name: coverage-report
43+
# path: unit-testing.cov

0 commit comments

Comments
 (0)