-
Notifications
You must be signed in to change notification settings - Fork 10
121 lines (115 loc) · 4.08 KB
/
callable-e2e-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
# copied from https://github.com/aws-amplify/amplify-js/blob/main/.github/workflows/callable-e2e-test.yml
name: E2E Test
run-name: e2e.${{ inputs.test_name }}
on:
workflow_call:
inputs:
test_name:
required: true
type: string
framework:
required: true
type: string
category:
required: true
type: string
sample_name:
required: true
type: string
spec:
required: true
type: string
browser:
required: true
type: string
amplifyjs_dir:
required: true
type: boolean
timeout_minutes:
required: true
type: number
retry_count:
required: true
type: number
env:
AMPLIFY_DIR: /home/runner/work/amplify-js/amplify-js/amplify-js
CYPRESS_GOOGLE_CLIENTID: ${{ secrets.CYPRESS_GOOGLE_CLIENTID }}
CYPRESS_GOOGLE_CLIENT_SECRET: ${{ secrets.CYPRESS_GOOGLE_CLIENT_SECRET }}
CYPRESS_GOOGLE_REFRESH_TOKEN: ${{ secrets.CYPRESS_GOOGLE_REFRESH_TOKEN }}
jobs:
e2e-test:
name: E2E ${{ inputs.test_name }}
runs-on: ubuntu-latest
strategy:
matrix:
browser:
- ${{ fromJson(inputs.browser) }}
sample_name:
- ${{ fromJson(inputs.sample_name) }}
fail-fast: false
timeout-minutes: ${{ inputs.timeout_minutes }}
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: maplibre-gl-js-amplify
- name: Setup node and build the repository
uses: ./maplibre-gl-js-amplify/.github/actions/node-and-build
- name: Setup samples staging repository
uses: ./maplibre-gl-js-amplify/.github/actions/setup-samples-staging
with:
GH_TOKEN_STAGING_READ: ${{ secrets.GH_TOKEN_STAGING_READ }}
- name: Load Verdaccio with maplibre gl js amplify
uses: ./maplibre-gl-js-amplify/.github/actions/load-verdaccio-with-maplibre-gl-js-amplify
- name: Run cypress tests for ${{ inputs.test_name }} dev
shell: bash
working-directory: ./amplify-js-samples-staging
env:
E2E_FRAMEWORK: ${{ inputs.framework }}
E2E_CATEGORY: ${{ inputs.category }}
E2E_SAMPLE_NAME: ${{ matrix.sample_name }}
E2E_SPEC: ${{ inputs.spec }}
E2E_BROWSER: ${{ matrix.browser }}
E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}}
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
E2E_TEST_NAME: ${{ inputs.test_name }}
run: |
yarn ci:test \
$E2E_FRAMEWORK \
$E2E_CATEGORY \
$E2E_SAMPLE_NAME \
$E2E_SPEC \
$E2E_BROWSER \
dev \
$E2E_AMPLIFY_JS_DIR
- name: Run cypress tests for ${{ inputs.test_name }} prod
shell: bash
working-directory: ./amplify-js-samples-staging
env:
E2E_FRAMEWORK: ${{ inputs.framework }}
E2E_CATEGORY: ${{ inputs.category }}
E2E_SAMPLE_NAME: ${{ matrix.sample_name }}
E2E_SPEC: ${{ inputs.spec }}
E2E_BROWSER: ${{ matrix.browser }}
E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}}
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
E2E_TEST_NAME: ${{ inputs.test_name }}
run: |
yarn ci:test \
$E2E_FRAMEWORK \
$E2E_CATEGORY \
$E2E_SAMPLE_NAME \
$E2E_SPEC \
$E2E_BROWSER \
prod \
$E2E_AMPLIFY_JS_DIR
- name: Upload artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.5.0 https://github.com/actions/upload-artifact/commit/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
if: failure()
with:
name: ${{ inputs.test_name }}
if-no-files-found: ignore
path: |
amplify-js-samples-staging/cypress/videos
amplify-js-samples-staging/cypress/screenshots
retention-days: 14