-
Notifications
You must be signed in to change notification settings - Fork 121
211 lines (184 loc) · 8.23 KB
/
deploy-wallet-at-pr.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
name: Deploy wallet preview to netlify at PR and pushes to it
on:
pull_request:
paths:
- "apps/namada-interface/**"
- "apps/extension/**"
- "packages/integrations/**"
- "packages/rpc/**"
- "packages/shared/**"
- "packages/tx/**"
- "packages/utils/**"
- "packages/wallet/**"
- "packages/wasm/**"
- ".github/workflows/**"
env:
CI: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- name: Run ESLint
run: yarn lint:ci
unit-tests-js:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- name: Restore Rust cache
uses: ./.github/actions/rust-cache
with:
cache-name: unit-tests-js
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Compile WASM
run: yarn wasm:build-test
- name: Run unit tests
id: run-unit-tests
run: yarn test:ci
- name: Report success
if: steps.run-unit-tests.outcome == 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests succeeded ✅\n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- name: Report failure
if: steps.run-unit-tests.outcome != 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests failed ⛔️ \n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
unit-tests-wasm:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Restore Rust cache
uses: ./.github/actions/rust-cache
with:
cache-name: unit-tests-wasm
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install wsrun
run: npm install -g wsrun
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Run unit tests
id: run-unit-tests
run: yarn test-wasm:ci
- name: Report success
if: steps.run-unit-tests.outcome == 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests succeeded ✅\n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- name: Report failure
if: steps.run-unit-tests.outcome != 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests failed ⛔️ \n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- name: Restore Rust cache
uses: ./.github/actions/rust-cache
with:
cache-name: build
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Rustup add target
run: rustup target add wasm32-unknown-unknown
- name: build the site
working-directory: ./apps/namada-interface
run: yarn build
env:
REACT_APP_NAMADA_ALIAS: "Namada Devnet"
REACT_APP_NAMADA_CHAIN_ID: "internal-devnet-6be.86067e06a5"
REACT_APP_NAMADA_URL: "https://proxy.heliax.click/internal-devnet-6be.86067e06a5"
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: "./apps/namada-interface/build"
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "deploy ${{ github.event.number }} at creating a PR"
alias: pull-request-${{ github.event.number }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN_WALLET_PREVIEW }}
NETLIFY_SITE_ID: 1f548c68-c620-4522-97e0-0d85c08366fb
# namada.me
# NETLIFY_SITE_ID: 2380782e-9b20-477a-bc27-b4e9d05e16f3
- name: Slack Notification
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"New deployment for a PR\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
E2E-tests:
needs: build
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/namada-interface
steps:
- uses: actions/checkout@v2
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- uses: actions/setup-node@v2
with:
node-version: "18.x"
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
id: run-playwright-tests
run: PLAYWRIGHT_BASE_URL=https://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app NETLIFY_SITE_PROTECTION_PASSWORD=${{ secrets.NETLIFY_SITE_PROTECTION_PASSWORD }} yarn playwright test
- name: report success
if: steps.run-playwright-tests.outcome == 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"E2E tests succeeded ✅\n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- name: report failure
if: failure() && steps.run-playwright-tests.outcome != 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"E2E tests failed ⛔️ \n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30