-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (107 loc) · 3.61 KB
/
sonarcloud.yml
File metadata and controls
114 lines (107 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Analysis
on:
push:
branches: [main, develop]
pull_request:
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
schedule:
- cron: "0 11 * * 0" # 3 AM PST = 11 AM UTC, runs Sundays
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
backend-tests:
name: Backend Tests
if: (! github.event.pull_request.draft)
runs-on: ubuntu-24.04
timeout-minutes: 15
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: default
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: bcgov/action-test-and-analyse@51b50be3bb2522e480ed8eab72735612deff7f15 # v1.4.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
commands: |
npm ci
npm run test:cov
dir: services
node_version: "20"
sonar_args: >
-Dsonar.exclusions=**/coverage/**,**/node_modules/**,**/*spec.ts
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=bcgov-alcs-services
-Dsonar.sources=apps,libs
-Dsonar.test.inclusions=**/*spec.ts
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar_token: ${{ env.SONAR_TOKEN }}
triggers: ('services/')
alcs-frontend-tests:
name: ALCS Frontend Tests
if: (! github.event.pull_request.draft)
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: bcgov/action-test-and-analyse@51b50be3bb2522e480ed8eab72735612deff7f15 # v1.4.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
commands: |
npm ci
npm run test:cov
dir: alcs-frontend
node_version: "24"
sonar_args: >
-Dsonar.exclusions=**/coverage/**,**/node_modules/**,**/*spec.ts
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=bcgov-alcs-frontend
-Dsonar.sources=src
-Dsonar.test.inclusions=**/*spec.ts
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar_token: ${{ env.SONAR_TOKEN }}
triggers: ('alcs-frontend/')
portal-frontend-tests:
name: Portal Frontend Tests
if: (! github.event.pull_request.draft)
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: bcgov/action-test-and-analyse@51b50be3bb2522e480ed8eab72735612deff7f15 # v1.4.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
commands: |
npm ci
npm run test:cov
dir: portal-frontend
node_version: "24"
sonar_args: >
-Dsonar.exclusions=**/coverage/**,**/node_modules/**,**/*spec.ts
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=bcgov-alcs-portal-frontend
-Dsonar.sources=src
-Dsonar.test.inclusions=**/*spec.ts
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar_token: ${{ env.SONAR_TOKEN }}
triggers: ('portal-frontend/')
results:
name: Analysis Results
needs: [backend-tests, alcs-frontend-tests, portal-frontend-tests]
if: (! github.event.pull_request.draft)
runs-on: ubuntu-24.04
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'canceled')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"