-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (121 loc) · 4.19 KB
/
Continuous-Integration.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
name: 'Continuous Integration'
'on':
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
cancelCurrentRuns:
name: 'Cancel in-progress Workflow runs'
runs-on: 'ubuntu-22.04'
steps:
- name: 'Cancel in-progress Workflow runs'
uses: 'styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa'
with:
access_token: '${{ secrets.GITHUB_TOKEN }}'
uiTest:
name: 'UI Tests'
runs-on: 'ubuntu-22.04'
steps:
- name: 'Mask any potential PII'
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\""
- name: 'Checkout the current branch'
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11'
with:
fetch-depth: 0
- name: 'Setup Node.js - 20'
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8'
with:
node-version: '>=20'
cache: 'npm'
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9'
name: 'Cache Node Modules'
with:
path: '~/.npm'
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}'
restore-keys: '${{ runner.os }}-node-'
- name: 'Install Gulp'
run: 'npm install -g gulp@5'
- name: 'Install Node modules'
run: 'npm ci'
- name: 'Set virtual display if Ubuntu'
if: 'runner.os == ''Linux'''
run: 'Xvfb :99 &'
- name: 'Setup Playwright dependencies'
run: 'npx playwright install --with-deps'
- name: 'Run UI tests'
run: 'gulp uiTests --max-old-space-size=8192'
env:
DISPLAY: ':99'
- name: 'Upload build artifacts if failed'
if: 'failure()'
uses: 'actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba'
with:
path: "apps/**/dist/\ndist/"
needs:
- 'cancelCurrentRuns'
unitTest:
name: 'Unit Tests'
runs-on: 'ubuntu-22.04'
steps:
- name: 'Mask any potential PII'
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\""
- name: 'Checkout the current branch'
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11'
with:
fetch-depth: 0
- name: 'Setup Node.js - 20'
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8'
with:
node-version: '>=20'
cache: 'npm'
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9'
name: 'Cache Node Modules'
with:
path: '~/.npm'
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}'
restore-keys: '${{ runner.os }}-node-'
- name: 'Install Gulp'
run: 'npm install -g gulp@5'
- name: 'Install Node modules'
run: 'npm ci'
- name: 'Set virtual display if Ubuntu'
if: 'runner.os == ''Linux'''
run: 'Xvfb :99 &'
- name: 'Setup Playwright dependencies'
run: 'npx playwright install --with-deps'
- name: 'Run unit tests'
run: 'gulp unitTests --max-old-space-size=8192'
needs:
- 'cancelCurrentRuns'
lint:
name: 'Lint'
runs-on: 'ubuntu-22.04'
needs:
- 'cancelCurrentRuns'
steps:
- name: 'Mask any potential PII'
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\""
- name: 'Checkout the current branch'
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11'
with:
fetch-depth: 0
- name: 'Setup Node.js - 20'
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8'
with:
node-version: '>=20'
cache: 'npm'
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9'
name: 'Cache Node Modules'
with:
path: '~/.npm'
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}'
restore-keys: '${{ runner.os }}-node-'
- name: 'Install Gulp'
run: 'npm install -g gulp@5'
- name: 'Install Node modules'
run: 'npm ci'
- name: 'Run Lint'
run: 'npm run lint'