-
Notifications
You must be signed in to change notification settings - Fork 139
162 lines (160 loc) · 4.24 KB
/
ci.yaml
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
name: Continuous Integration
on:
push:
pull_request:
branches:
- master
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
name: Check
steps:
- uses: actions/checkout@v3
- name: Lint
run: make lint
- name: Types
run: make test-types
unit_test:
runs-on: ubuntu-latest
name: Unit test
strategy:
fail-fast: false
matrix:
browser:
- Chrome
- Firefox
- Electron
steps:
- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-firefox@v1
- uses: actions/checkout@v3
- name: Unit test
uses: coactions/setup-xvfb@v1
env:
BROWSER: ${{ matrix.browser }}
DISPLAY: :99
with:
run: make test-unit-ci
unit_test_remote:
runs-on: ubuntu-latest
name: Unit test
strategy:
max-parallel: 5
fail-fast: false
matrix:
browser:
- Safari-Remote
- Edge-Remote
- iOS-16-Remote
- iOS-15-Remote
- Android-13-Remote
- Android-12-Remote
- Android-11-Remote
steps:
- uses: actions/checkout@v3
- name: Unit test
uses: nick-fields/retry@v2
env:
BROWSER: ${{ matrix.browser }}
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
with:
timeout_minutes: 12
max_attempts: 2
command: make test-unit-ci
e2e_test:
runs-on: ubuntu-latest
name: End-to-end test
needs: unit_test_remote
strategy:
max-parallel: 5
fail-fast: false
matrix:
browser:
- Chrome-Remote
- Firefox-Remote
- Safari-Remote
- Edge-Remote
- iOS-16-Remote
- iOS-15-Remote
- Android-13-Remote
- Android-12-Remote
- Android-11-Remote
steps:
- uses: actions/checkout@v3
- name: End-to-end test
uses: nick-fields/retry@v2
env:
BROWSER: ${{ matrix.browser }}
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
with:
timeout_minutes: 16
max_attempts: 2
command: make test-e2e-ci
integration_test:
runs-on: ubuntu-latest
name: Integration test with react-recurly
steps:
- uses: actions/checkout@v3
with:
repository: recurly/react-recurly
path: vendor
- name: react-recurly
env:
RECURLY_JS_SHA: ${{ github.sha }}
run: |-
cd vendor
make test
verify:
runs-on: ubuntu-latest
name: Verify required checks
if: ${{ always() }}
needs:
- check
- unit_test
- unit_test_remote
- e2e_test
- integration_test
steps:
- name: Check status for pull requests
if: |-
${{
github.event_name == 'pull_request'
&& needs.check.result != 'success'
&& needs.unit_test.result != 'success'
&& needs.unit_test_remote.result != 'success'
&& needs.e2e_test.result != 'success'
&& needs.integration_test.result != 'success'
}}
run: exit 1
publish:
runs-on: ubuntu-latest
name: Publish artifacts
needs:
- check
- unit_test
- unit_test_remote
steps:
- uses: actions/checkout@v3
- uses: browser-actions/setup-chrome@v1
- name: Build
run: make build
- name: Report coverage
uses: coactions/setup-xvfb@v1
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
DISPLAY: :99
with:
run: make test-unit-cov-ci
- uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCR_QA_PUBLIC_DEVOPS_SA }}
- uses: google-github-actions/upload-cloud-storage@v1
with:
path: build
destination: ${{ secrets.ARTIFACT_BUCKET_NAME }}/recurly-js/${{ github.sha }}/
parent: false