-
Notifications
You must be signed in to change notification settings - Fork 359
259 lines (232 loc) · 8.33 KB
/
build-test-deploy.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
name: Build and deploy to IPFS
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
!contains(github.head_ref, 'dependabot'))
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
persist-credentials: false
- name: Build App
uses: ./.github/actions/build
with:
NEXT_PUBLIC_ENV: 'prod'
NEXT_PUBLIC_FORK_BASE_CHAIN_ID: ${{ secrets[format('FORK_BASE_CHAIN_ID_{0}', github.event.pull_request.number)] }}
NEXT_PUBLIC_FORK_CHAIN_ID: ${{ secrets[format('FORK_CHAIN_ID_{0}', github.event.pull_request.number)] }}
NEXT_PUBLIC_FORK_URL_RPC: ${{ secrets[format('FORK_URL_RPC_{0}', github.event.pull_request.number)] }}
NEXT_PUBLIC_MIXPANEL: ${{ secrets.NEXT_PUBLIC_MIXPANEL }}
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_SUBGRAPH_API_KEY: ${{ secrets.NEXT_PUBLIC_SUBGRAPH_API_KEY }}
- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
with:
BUILD_ARTIFACT_NAME: 'out'
build_staging:
runs-on: ubuntu-latest
if: |
github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
persist-credentials: false
- name: Build App
uses: ./.github/actions/build
with:
NEXT_PUBLIC_ENV: 'staging'
- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
with:
BUILD_ARTIFACT_NAME: 'out_staging'
NEXTJS_BUILD: 'false'
PR_INFO: 'false'
cypress_smoke_v2:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip cypress]')"
needs: build
strategy:
fail-fast: false
matrix:
market:
- polygon
- avalanche
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: Run tests
uses: ./.github/actions/cypress
with:
CYPRESS_TENDERLY_ACCOUNT: ${{ secrets.TENDERLY_ACCOUNT }}
CYPRESS_TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
CYPRESS_TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
YARN_TEST_COMMAND: npx cypress-repeat run -n 2 --rerun-failed-only --config-file ./cypress/configs/v2-markets/${{ matrix.market }}-v2-smoke.config.ts
cypress_smoke_v3:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip cypress]')"
needs: build
strategy:
fail-fast: false
matrix:
market:
- polygon
- avalanche
- optimism
- ethereum
- gho
- base
- gnosis
- bnb
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: Run tests
uses: ./.github/actions/cypress
with:
CYPRESS_TENDERLY_ACCOUNT: ${{ secrets.TENDERLY_ACCOUNT }}
CYPRESS_TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
CYPRESS_TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
YARN_TEST_COMMAND: npx cypress-repeat run -n 2 --rerun-failed-only --config-file ./cypress/configs/v3-markets/${{ matrix.market }}-v3-smoke.config.ts
next_js_analyze:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: download build
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
with:
name: nextjs_build
path: .next
- uses: ./.github/actions/analyze-comment
if: github.event_name != 'pull_request'
- uses: ./.github/actions/analyze-comment
if: github.event_name == 'pull_request'
with:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
deploy:
runs-on: ubuntu-latest
needs:
- build
outputs:
pinata_hash: '${{ steps.pinata.outputs.hash }}'
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: download build
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
with:
name: out
path: out
- name: pinata
id: pinata
uses: aave/pinata-action@35662944e92cf082457973f10aa42e48df179b47
with:
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
PINATA_SECRET_KEY: ${{ secrets.PINATA_SECRET_KEY }}
PIN_ALIAS: 'app-aave-${{ github.head_ref || github.ref }}'
BUILD_LOCATION: './out'
CID_VERSION: 1
cypress_full_v2:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip cypress]')"
needs:
- deploy
- cypress_smoke_v2
- cypress_smoke_v3
strategy:
fail-fast: false
matrix:
market:
- polygon
- avalanche
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: Run tests
uses: ./.github/actions/cypress
with:
CYPRESS_TENDERLY_ACCOUNT: ${{ secrets.TENDERLY_ACCOUNT }}
CYPRESS_TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
CYPRESS_TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
YARN_TEST_COMMAND: npx cypress-repeat run -n 2 --rerun-failed-only --config-file ./cypress/configs/v2-markets/${{ matrix.market }}-v2-full.config.ts
cypress_full_v3:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip cypress]')"
needs:
- deploy
- cypress_smoke_v2
- cypress_smoke_v3
strategy:
fail-fast: false
matrix:
market:
- polygon
- optimism
- ethereum
- gho
- base
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: Run tests
uses: ./.github/actions/cypress
with:
CYPRESS_TENDERLY_ACCOUNT: ${{ secrets.TENDERLY_ACCOUNT }}
CYPRESS_TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
CYPRESS_TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
YARN_TEST_COMMAND: npx cypress-repeat run -n 2 --rerun-failed-only --config-file ./cypress/configs/v3-markets/${{ matrix.market }}-v3-full.config.ts
cypress_app_functionality:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip cypress]')"
needs:
- deploy
- cypress_smoke_v2
- cypress_smoke_v3
strategy:
fail-fast: false
matrix:
scoupe:
- settings
- mobile
- governance-stake
- widgets
- general
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: Run tests
uses: ./.github/actions/cypress
with:
CYPRESS_TENDERLY_ACCOUNT: ${{ secrets.TENDERLY_ACCOUNT }}
CYPRESS_TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
CYPRESS_TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
YARN_TEST_COMMAND: npx cypress-repeat run -n 2 --rerun-failed-only --config-file ./cypress/configs/${{ matrix.scoupe }}.config.ts
update_domains:
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
!contains(github.event.head_commit.message, '[skip cypress]')
needs:
- deploy
- build_staging
- cypress_full_v2
- cypress_full_v3
- cypress_app_functionality
uses: ./.github/workflows/update-prod-staging.yml
with:
PINATA_HASH: '${{ needs.deploy.outputs.pinata_hash }}'
secrets: inherit
update_domains_no_cypress:
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
contains(github.event.head_commit.message, '[skip cypress]')
needs:
- deploy
- build_staging
uses: ./.github/workflows/update-prod-staging.yml
with:
PINATA_HASH: '${{ needs.deploy.outputs.pinata_hash }}'
secrets: inherit