Skip to content

Commit 9799cd0

Browse files
author
Gonzalo Diaz
committed
Revert "[CONFIG] [REFACTOR] [Github Actions] codecov and sonarcloud now runs in parallel."
This reverts commit 59cbdd066feeb14a6bef1f09250a97b1b1779ad8. [CONFIG] [REFACTOR] [Github Actions] codecov and sonarcloud now runs in parallel.
1 parent fc6f43c commit 9799cd0

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

.github/workflows/go-coverage.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
jobs:
1717

18-
coverage:
18+
build-and-test:
1919
name: "Go CI Tests Coverage"
2020
strategy:
2121
fail-fast: false
@@ -41,21 +41,56 @@ jobs:
4141
run: >
4242
go test -v
4343
-covermode=atomic
44+
-coverpkg=./...
4445
-coverprofile="coverage.out"
4546
./exercises/...
4647
4748
- name: Coverage
4849
run: go tool cover -func="coverage.out"
4950

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+
5068
- name: Upload coverage reports to Codecov with GitHub Action
5169
uses: codecov/codecov-action@v5
5270
with:
71+
files: coverage/coverage.out
5372
token: ${{ secrets.CODECOV_TOKEN }} # required
5473
verbose: true # optional (default = false)
5574

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
5793
uses: SonarSource/sonarqube-scan-action@master
5894
env:
5995
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
60-
# Needed to get PR information, if any
6196
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)