-
Notifications
You must be signed in to change notification settings - Fork 293
164 lines (154 loc) · 5.48 KB
/
build-system-test.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
# Description: this workflow runs build mega-apps that have all the connected components.
name: Build System Test Canary
permissions:
id-token: write # This is required for aws-actions/configure-aws-credentials
on:
schedule:
- cron: '*/30 * * * *' # Run every 30 minutes
jobs:
build:
runs-on: ubuntu-latest
environment: ci
strategy:
fail-fast: false
matrix:
framework: [react]
framework-version: [latest]
build-tool: [cra, next, vite]
build-tool-version: [latest]
pkg-manager: [npm]
language: [ts]
node-version: [18]
pkg-manager-version: [latest]
include:
- framework: react
framework-version: latest
build-tool: cra
build-tool-version: latest
pkg-manager: npm
language: ts
node-version: 20
- framework: react
framework-version: 16
build-tool: cra
build-tool-version: latest
pkg-manager: npm
language: ts
node-version: 20
- framework: react
framework-version: latest
build-tool: cra
build-tool-version: latest
pkg-manager: npm
language: js
node-version: 20
- framework: react
framework-version: latest
build-tool: cra
build-tool-version: latest
pkg-manager: yarn
pkg-manager-version: 1
language: ts
node-version: 20
- framework: react
framework-version: 18
build-tool: next
build-tool-version: 12
pkg-manager: npm
language: ts
node-version: 20
- framework: react
framework-version: latest
build-tool: vite
build-tool-version: 2
pkg-manager: npm
language: ts
node-version: 20
- framework: angular
framework-version: latest
build-tool: angular-cli
build-tool-version: latest
pkg-manager: npm
language: ts
node-version: 20
- framework: angular
framework-version: 14
build-tool: angular-cli
build-tool-version: 14
pkg-manager: npm
language: ts
node-version: 20
- framework: vue
framework-version: 3 # here use "3" instead of "latest" because .vuerc(preset) doesn't accept "latest" as "vueVersion"
build-tool: vue-cli
build-tool-version: latest
pkg-manager: yarn # vue-cli defualt pkg-manager is yarn. It can't be customized in the preset.json.
language: ts
node-version: 20
- framework: vue
framework-version: latest
build-tool: vite
build-tool-version: latest
pkg-manager: npm
language: ts
node-version: 20
- framework: vue
framework-version: latest
build-tool: vite
build-tool-version: 3
pkg-manager: npm
language: ts
node-version: 20
- framework: vue
framework-version: latest
build-tool: nuxt
build-tool-version: latest
pkg-manager: npm
language: ts
node-version: 20
env:
MEGA_APP_NAME: ${{ matrix.framework }}-${{ matrix.framework-version }}-${{ matrix.build-tool }}-${{ matrix.build-tool-version }}-${{ matrix.language }}
steps:
- name: Checkout Amplify UI
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }} with ${{ matrix.pkg-manager }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 https://github.com/actions/setup-node/commit/60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{ matrix.node-version }}
cache: ${{ matrix.pkg-manager }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- name: Create MegaApp ${{ env.MEGA_APP_NAME }} and run build on NodeJS ${{ matrix.node-version }}
run: npm run ${{ env.MEGA_APP_NAME }}
shell: bash
working-directory: build-system-tests
log-failure-metric:
# Send a failure data point to metric BuildSystemTestFailure in github-workflows@ us-east-2
runs-on: ubuntu-latest
environment: ci
needs: build
if: ${{ failure() }}
steps:
- name: Log failure data point to metric BuildSystemTestFailure
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: BuildSystemTestFailure
value: 1
role-to-assume: ${{ secrets.METRIC_LOGGER_ROLE_ARN }}
aws-region: us-east-2
log-success-metric:
# Send a success data point to metric BuildSystemTestFailure in github-workflows@ us-east-2
runs-on: ubuntu-latest
environment: ci
needs: build
if: ${{ success() }}
steps:
- name: Log success data point to metric BuildSystemTestFailure
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: BuildSystemTestFailure
value: 0
role-to-assume: ${{ secrets.METRIC_LOGGER_ROLE_ARN }}
aws-region: us-east-2