-
-
Notifications
You must be signed in to change notification settings - Fork 74
167 lines (147 loc) · 5.54 KB
/
ci.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
workflow_dispatch:
env:
REACT_APP_TEST_STUDENT1_PASSWORD: ${{ secrets.STUDENT1_PASSWORD }}
REACT_APP_TEST_TEACHER1_PASSWORD: ${{ secrets.TEACHER1_PASSWORD }}
REACT_APP_TEST_MANAGER1_PASSWORD: ${{ secrets.MANAGER1_PASSWORD }}
REACT_APP_TEST_MONITOR1_PASSWORD: ${{ secrets.MONITOR1_PASSWORD }}
REACT_APP_AWS_REGION: eu-west-3
REACT_APP_USERPOOL_ID: ${{ vars.PREPROD_USERPOOL_ID }}
REACT_APP_WEBCLIENT_ID: ${{ vars.PREPROD_WEBCLIENT_ID }}
REACT_APP_OAUTH_DOMAIN: ${{ vars.PREPROD_OAUTH_DOMAIN }}
jobs:
style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.19.0
## Connect to Numer Private Codeartifact Repository ##
- name: Configure prod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315
## Connect to Numer Private Codeartifact Repository ##
- name: Configure preprod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
unset-current-credentials: true
- run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189
## Install npm dependencies ##
- name: Install npm dependencies
run: npm ci
## Run prettier to check code style ##
- name: Check style
run: npm run format:check
test-e2e:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.19.0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
## Connect to Numer Private Codeartifact Repository ##
- name: Configure prod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315
## Connect to Numer Private Codeartifact Repository ##
- name: Configure preprod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
unset-current-credentials: true
- run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189
- run: npm install --location=global sonar-scanner
## Read version file ##
- name: Read version file
if: always()
id: read-version
uses: CumulusDS/[email protected]
with:
file: version.yml
version: version
## Run Cypress e2e tests ##
- name: Run e2e tests
uses: cypress-io/github-action@v6
with:
start: npm run dev
## Merge test reports ##
- name: Merge test reports
if: always()
run: |
npm run test:merge:reports
## SonarQube Cloud Scan ##
- name: SonarQube Cloud Scan
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_FOR_CONVENTIONAL_CHANGELOG }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
-Dsonar.projectVersion=${{ steps.read-version.outputs.version }} \
-Dsonar.host.url=https://sonarcloud.io \
build:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.19.0
## Connect to Numer Private Codeartifact Repository ##
- name: Configure prod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315
## Connect to Numer Private Codeartifact Repository ##
- name: Configure preprod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
unset-current-credentials: true
- run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189
## Install npm dependencies ##
- name: Install npm dependencies
run: npm ci
## Build the application with vite and typescript ##
- name: Build app
run: npm run build