-
Notifications
You must be signed in to change notification settings - Fork 26
267 lines (261 loc) · 9.75 KB
/
check.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: Check
on:
push:
branches: [main, develop, feature/*, tagged-release/*]
pull_request:
branches: [main, develop, feature/*, tagged-release/*]
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
amplify-cli-tests-v5:
runs-on: ubuntu-latest
steps:
- name: Checkout Studio Codegen
uses: actions/checkout@v2
with:
path: amplify-codegen-ui
repository: aws-amplify/amplify-codegen-ui
- name: Checkout Amplify CLI
uses: actions/checkout@v2
with:
path: amplify-cli
repository: aws-amplify/amplify-cli
- name: Setup Node.js LTS/gallium
uses: actions/setup-node@v2
with:
node-version: lts/gallium
- name: Build amplify-codegen-ui
working-directory: amplify-codegen-ui
run: |
npm ci
npx lerna bootstrap
npm run build
- name: Package amplify-codegen-ui
working-directory: amplify-codegen-ui
run: npx lerna exec npm pack
- name: Build amplify-cli
working-directory: amplify-cli
run: |
yarn install
yarn setup-dev
- name: Install updated codegen libraries
working-directory: amplify-cli/packages/amplify-util-uibuilder
run: |
yarn add ../../../amplify-codegen-ui/packages/codegen-ui/aws-amplify-codegen-ui-*.tgz
yarn add ../../../amplify-codegen-ui/packages/codegen-ui-react/aws-amplify-codegen-ui-react-*.tgz
- name: Build amplify-cli with updated codegen libraries
working-directory: amplify-cli
run: |
yarn install
yarn build
echo "$HOME/work/amplify-codegen-ui/amplify-codegen-ui/amplify-cli/.bin" >> $GITHUB_PATH
- name: Create a test react app
run: npx create-react-app e2e-test-app
- name: Install test app dependencies
working-directory: e2e-test-app
run: |
npm i aws-amplify@^5.0.0 @aws-amplify/ui-react@^5.0.0
npm i --save-dev cypress
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.E2E_TEST_ROLE_ARN }}
aws-region: us-west-2
- name: Create temp AWS credentials file
working-directory: e2e-test-app
run: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && \
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && \
aws configure set aws_session_token $AWS_SESSION_TOKEN && \
aws configure set default.region $AWS_REGION
- name: Run CLI Pull in test app
working-directory: e2e-test-app
run: |
FORCE_RENDER=1 amplify-dev pull --appId ${{ secrets.E2E_TEST_APP_ID }} --envName staging -y --providers "{\
\"awscloudformation\":{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\",\
}\
}"
- name: Write test files
working-directory: e2e-test-app
run: cp -r ../amplify-codegen-ui/packages/test-generator/e2e-test-templates/. .
- name: Cypress run
uses: cypress-io/github-action@v5
with:
working-directory: e2e-test-app
install: false
start: npm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
config-file: cypress.config.js
env:
REACT_APP_USER_EMAIL: ${{ secrets.E2E_TEST_USER_EMAIL }}
REACT_APP_USER_PASSWORD: ${{ secrets.E2E_TEST_USER_PASSWORD }}
- name: Upload Cypress videos
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: /home/runner/work/amplify-codegen-ui/amplify-codegen-ui/e2e-test-app/cypress/videos
amplify-cli-tests-v6:
runs-on: ubuntu-latest
steps:
- name: Checkout Studio Codegen
uses: actions/checkout@v2
with:
path: amplify-codegen-ui
repository: aws-amplify/amplify-codegen-ui
- name: Checkout Amplify CLI
uses: actions/checkout@v2
with:
path: amplify-cli
repository: aws-amplify/amplify-cli
- name: Setup Node.js LTS/gallium
uses: actions/setup-node@v2
with:
node-version: lts/gallium
- name: Build amplify-codegen-ui
working-directory: amplify-codegen-ui
run: |
npm ci
npx lerna bootstrap
npm run build
- name: Package amplify-codegen-ui
working-directory: amplify-codegen-ui
run: npx lerna exec npm pack
- name: Build amplify-cli
working-directory: amplify-cli
run: |
yarn install
yarn setup-dev
- name: Install updated codegen libraries
working-directory: amplify-cli/packages/amplify-util-uibuilder
run: |
yarn add ../../../amplify-codegen-ui/packages/codegen-ui/aws-amplify-codegen-ui-*.tgz
yarn add ../../../amplify-codegen-ui/packages/codegen-ui-react/aws-amplify-codegen-ui-react-*.tgz
- name: Build amplify-cli with updated codegen libraries
working-directory: amplify-cli
run: |
yarn install
yarn build
echo "$HOME/work/amplify-codegen-ui/amplify-codegen-ui/amplify-cli/.bin" >> $GITHUB_PATH
- name: Create a test react app
run: npx create-react-app e2e-test-app
- name: Install test app dependencies
working-directory: e2e-test-app
run: |
npm i aws-amplify@^6.0.0 @aws-amplify/ui-react@^6.0.0
npm i --save-dev cypress
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.E2E_TEST_ROLE_ARN }}
aws-region: us-west-2
- name: Create temp AWS credentials file
working-directory: e2e-test-app
run: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && \
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && \
aws configure set aws_session_token $AWS_SESSION_TOKEN && \
aws configure set default.region $AWS_REGION
- name: Run CLI Pull in test app
working-directory: e2e-test-app
run: |
FORCE_RENDER=1 amplify-dev pull --appId ${{ secrets.E2E_TEST_APP_ID }} --envName staging -y --providers "{\
\"awscloudformation\":{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\",\
}\
}"
- name: Write test files
working-directory: e2e-test-app
run: cp -r ../amplify-codegen-ui/packages/test-generator/e2e-test-templates-amplify-js-v6/. .
- name: Cypress run
uses: cypress-io/github-action@v5
with:
working-directory: e2e-test-app
install: false
start: npm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
config-file: cypress.config.js
env:
REACT_APP_USER_EMAIL: ${{ secrets.E2E_TEST_USER_EMAIL }}
REACT_APP_USER_PASSWORD: ${{ secrets.E2E_TEST_USER_PASSWORD }}
- name: Upload Cypress videos
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: /home/runner/work/amplify-codegen-ui/amplify-codegen-ui/e2e-test-app-v6/cypress/videos
functional-tests-v5:
runs-on: ubuntu-latest
steps:
- name: Checkout Studio Codegen
uses: actions/checkout@v2
- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
- name: Install packages
run: npm ci
- name: Lerna bootstrap
run: npm run bootstrap
- name: Setup Integration Test
run: npm run integ:setup
- name: Cypress run
uses: cypress-io/github-action@v5
with:
working-directory: packages/integration-test
install: false
start: npm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 210
config-file: cypress.config.ts
- name: Upload Cypress videos
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: /home/runner/work/amplify-codegen-ui/amplify-codegen-ui/packages/integration-test/cypress/videos
- name: Check Integ Test Coverage
working-directory: packages/integration-test
run: node cypress/scripts/generateCoverageSummary.mjs
functional-tests-v6:
runs-on: ubuntu-latest
steps:
- name: Checkout Studio Codegen
uses: actions/checkout@v2
- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
- name: Install packages
run: npm ci
- name: Lerna bootstrap
run: npm run bootstrap
- name: Setup Integration Test
run: npm run integ:setupv6
- name: Cypress run
uses: cypress-io/github-action@v5
with:
working-directory: packages/integration-test
install: false
start: npm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 210
config-file: cypress.config.ts
- name: Upload Cypress videos
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: /home/runner/work/amplify-codegen-ui/amplify-codegen-ui/packages/integration-test/cypress/videos
- name: Check Integ Test Coverage
working-directory: packages/integration-test
run: node cypress/scripts/generateCoverageSummary.mjs