Skip to content

Commit 4d4a908

Browse files
authored
Merge pull request #960
* chore(32824): add dispatch to the workflow triggers * chore(32824): fix README.md * chore(32824): fix sonar-qube project configuration * chore(32824): test config * chore(32824): add verbose * chore(31411): debug * chore(32824): remove secrets out of conditional job * chore(32824): remove secrets out of conditional job * chore(31411): fix working-directory * chore(32824): remove deprecated steps * chore(32824): test secrets * chore(31411): add basic sonarqube config * chore(32824): test path * chore(32824): messing with env * Revert "chore(32824): messing with env" * chore(32824): remove from CI check * chore(32824): remove from CI check * chore(32824): remove from CI check * Adde secrets as input parameters * chore(32824): cleaning up * chore(32662): merge jobs * chore(32662): try reportPaths * chore(32662): try reportPaths * chore(32662): try reportPaths * chore(32662): try reportPaths * chore(32662): try reportPaths * chore(32662): add combined code cov directory * chore(32662): try check out * chore(32662): restore reportPaths * chore(32824): fix checkout * chore(32662): test run * chore(32662): test run * chore(32662): fix options
1 parent b5c89e6 commit 4d4a908

File tree

5 files changed

+36
-30
lines changed

5 files changed

+36
-30
lines changed

.github/workflows/check-frontend.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,18 @@
44
name: Frontend - React Testing Pyramid
55

66
on:
7+
workflow_dispatch:
78
workflow_call:
8-
# push:
9-
# paths:
10-
# - hivemq-edge-frontend/**
11-
# - .github/workflows/frontend-cli.yml
12-
# - .github/actions/setup_node/action.yml
13-
env:
14-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9+
secrets:
10+
SONAR_TOKEN:
11+
required: false
12+
PERCY_TOKEN:
13+
required: false
1514

1615
defaults:
1716
run:
1817
working-directory: ./hivemq-edge-frontend/
1918

20-
## Cancel previous workflow on a follow-up push event
21-
## https://stackoverflow.com/a/72408109
22-
#concurrency:
23-
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
24-
# cancel-in-progress: true
25-
2619
jobs:
2720
lint:
2821
runs-on: ubuntu-latest
@@ -163,32 +156,33 @@ jobs:
163156
if-no-files-found: ignore
164157
retention-days: 1
165158

166-
combine_code_coverage:
167-
runs-on: ubuntu-latest
159+
sonarqube:
160+
name: SonarQube
168161
needs: [ cypress_matrix, unit_tests ]
169162
# Should we collect partial test results and combine them ?
170163
if: success() || failure()
164+
runs-on: ubuntu-latest
171165
steps:
172-
- name: Download All LCOV Artifacts
166+
- name: 👓 Checkout repository
167+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
168+
with:
169+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
170+
- name: Download all LCOV Artifacts
173171
uses: actions/download-artifact@v4
174172
with:
175173
path: hivemq-edge-frontend/coverage-combined
176174
pattern: lcov-*
177175
merge-multiple: false
178-
# Should contain the lcov.info summary, in subdirectory named from the tasks
179-
- run: ls -R ./coverage-combined
180-
181-
sonarqube:
182-
name: SonarQube
183-
needs: [ combine_code_coverage ]
184-
runs-on: ubuntu-latest
185-
steps:
186-
- uses: actions/checkout@v4
187-
with:
188-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
176+
- name: Verify LCOV Artifacts
177+
# Should contain the lcov.info summary, in subdirectory named from the tasks
178+
run: |
179+
ls -R ./coverage-combined
180+
ls -R **/**/*.info
189181
- name: SonarQube Scan
190182
uses: SonarSource/sonarqube-scan-action@v5
191183
with:
192184
projectBaseDir: hivemq-edge-frontend
185+
args: >
186+
-Dsonar.verbose=false
193187
env:
194188
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/check.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: CI Check
33
on:
44
push:
55

6+
env:
7+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8+
# For frontend usage; secrets cannot be accessed in a conditional job
9+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
11+
612
concurrency:
713
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
814
cancel-in-progress: true
@@ -42,6 +48,9 @@ jobs:
4248
needs: check-for-changes
4349
uses: ./.github/workflows/check-frontend.yml
4450
if: needs.check-for-changes.outputs.frontend-changed == 'true'
51+
secrets:
52+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
53+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
4554

4655
check-backend:
4756
needs: check-for-changes

hivemq-edge-frontend/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,5 @@ Together. they contain - and enforce - parts of the testing pyramid for frontend
140140
### Percy - Visual testing
141141

142142
### Lighthouse - Performance testing
143+
144+
### SonarQube Cloud
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#### Combined code coverage

hivemq-edge-frontend/sonar-project.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
sonar.projectKey=vanch3d_hivemq-edge
2-
sonar.organization=vanch3d
1+
sonar.projectKey= hivemq_hivemq-edge
2+
sonar.organization=hivemq
33

44

55
# This is the name and version displayed in the SonarCloud UI.
6-
sonar.projectName=vanch3d_hivemq-edge
6+
sonar.projectName=hivemq_hivemq-edge
77
sonar.projectVersion=1.0
88

99

0 commit comments

Comments
 (0)