-
Notifications
You must be signed in to change notification settings - Fork 19
193 lines (157 loc) · 5.48 KB
/
smoke-test-all.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Smoke test - Release
on:
schedule:
# Runs every morning at 05:00
- cron: '0 5 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
branch:
description: 'Branch name'
required: true
default: 'develop'
type: string
nodeVersion:
description: 'Node version'
required: true
default: '20.9.0'
type: string
jobs:
build-core:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/core
outputs:
version: ${{ steps.core-version.outputs.PACKAGE_VERSION }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
- name: Core - Read Package.json Version
id: core-version
working-directory: ${{ env.WORKING_DIRECTORY }}
run: echo "PACKAGE_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Install dependencies in root
run: npm install
- name: Core - Install
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npm install
- name: Core - Run build
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npm run build
build-angular:
needs: build-core
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/angular
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
- name: Angular - Read package.json Version
id: version
working-directory: packages/angular
run: echo "PACKAGE_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Install dependencies in root
run: npm install
- name: Core - Install
working-directory: packages/core
run: npm install
- name: Angular - Install
working-directory: packages/angular
run: npm install
- name: Angular - Install latest tegel package
working-directory: packages/angular
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}
- name: Angular - Run build
run: npm run build:angular
build-angular-17:
needs: build-core
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/angular-17
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
- name: Angular-17 - Read package.json Version
id: version
working-directory: packages/angular-17/projects/components
run: echo "PACKAGE_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Install dependencies in root
run: npm install
- name: Core - Install
working-directory: packages/core
run: npm install
- name: Angular-17 workspace - Install
working-directory: packages/angular-17
run: npm install
- name: Angular-17 wrapper - Install
working-directory: packages/angular-17/projects/components
run: npm install
- name: Angular-17 workspace - Install latest tegel package
working-directory: packages/angular-17
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}
- name: Angular-17 wrapper - Install latest tegel package
working-directory: packages/angular-17/projects/components
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}
- name: Angular-17 - Run build
run: npm run build:angular-17
build-react:
needs: build-core
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/react
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
- name: React - Read package.json Version
id: version
working-directory: packages/react
run: echo "PACKAGE_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Install dependencies in root
run: npm install
- name: Core - Install
working-directory: packages/core
run: npm install
- name: React - Install
working-directory: packages/react
run: npm install
- name: React - Install latest tegel package
working-directory: packages/react
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}
- name: React - Build
run: npm run build:react
# Check that all jobs pass
check-results:
needs: [build-core, build-angular, build-angular-17, build-react]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify in Teams on failure
uses: ./.github/workflows/smoke-test-webhook.yml