forked from trezor/trezor-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (171 loc) · 6.87 KB
/
connect-dev-release-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
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
name: "[Build/Test] Connect Explorer"
permissions:
id-token: write # for fetching the OIDC token
contents: read # for actions/checkout
on:
schedule:
# Runs at midnight UTC every day at 01:00 AM CET
- cron: "0 0 * * *"
push:
branches: [npm-release/*, release/*]
pull_request:
paths:
- "packages/blockchain-link/**"
- "packages/connect/**"
- "packages/connect-common/**"
- "packages/connect-iframe/**"
- "packages/connect-explorer/**"
- "packages/connect-webextension/**"
- "packages/connect-web/**"
- "packages/transport/**"
- "packages/utxo-lib/**"
- "packages/utils/**"
- "submodules/trezor-common/**"
- "yarn.lock"
- ".github/workflows/connect-dev-release-test.yml"
- ".github/workflows/template-connect-popup-test-params.yml"
concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DEV_SERVER_HOSTNAME: "dev.suite.sldev.cz"
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Pull only files needed for connect to save LFS bandwidth
- name: "Pull LFS files for connect"
run: git lfs pull --include "packages/connect-common/files/**/*"
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_trezor_suite_dev_deploy
aws-region: eu-central-1
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: |
echo -e "\nenableScripts: false" >> .yarnrc.yml
yarn workspaces focus @trezor/connect-iframe @trezor/connect-web @trezor/connect-popup @trezor/connect-webextension @trezor/connect-explorer
- name: Build connect-web
run: |
yarn workspace @trezor/connect-web build
- name: Check connect-web build size
run: ./packages/connect-web/scripts/check-inline-build-size.sh
- name: Build connect-iframe
run: |
yarn workspace @trezor/connect-iframe build
- name: Build connect-popup
run: |
yarn workspace @trezor/connect-popup build
- name: Build connect-webextension
run: |
yarn workspace @trezor/connect-webextension build
- name: Build connect-explorer
env:
ASSET_PREFIX: /connect/${{ steps.extract_branch.outputs.branch }}
NODE_ENV: "production"
url: https://${{ env.DEV_SERVER_HOSTNAME }}/connect/${{ steps.extract_branch.outputs.branch }}
__TREZOR_CONNECT_SRC: https://${{ env.DEV_SERVER_HOSTNAME }}/connect/${{ steps.extract_branch.outputs.branch }}/
run: |
yarn workspace @trezor/connect-explorer build
- name: Build connect-examples webextension
env:
FULL_URL: https://${{ env.DEV_SERVER_HOSTNAME }}/connect/${{ steps.extract_branch.outputs.branch }}/
run: |
echo "FULL_URL is set to ${FULL_URL}"
node ./packages/connect-examples/update-webextensions.js --trezor-connect-src "${FULL_URL}"
node ./packages/connect-examples/update-webextensions.js --trezor-connect-src "${FULL_URL}" --build-folder build-legacy --npm-src "https://connect.trezor.io/9/trezor-connect.js"
node ./packages/connect-examples/update-webextensions-sw.js
- name: Build connect-explorer-webextension
run: |
yarn workspace @trezor/connect-explorer build:webextension
# this step should upload build result to s3 bucket DEV_SERVER_HOSTNAME using awscli
- name: Upload connect-explorer to dev.suite.sldev.cz
env:
DEPLOY_PATH: s3://${{ env.DEV_SERVER_HOSTNAME }}/connect/${{ steps.extract_branch.outputs.branch }}
run: |
echo "DEPLOY_PATH is set to ${DEPLOY_PATH}"
mkdir -p tmp_build_directory
cp -R ./packages/connect-iframe/build/* tmp_build_directory/
cp -R ./packages/connect-popup/build/* tmp_build_directory/
cp -R ./packages/connect-web/build/* tmp_build_directory/
cp -R ./packages/connect-explorer/build/* tmp_build_directory/
aws s3 sync --delete tmp_build_directory/ "${DEPLOY_PATH}"
- name: Upload connect-example webextension artifacts
uses: actions/upload-artifact@v4
with:
name: connect-example-webextension
path: |
packages/connect-examples/webextension-mv2/build
packages/connect-examples/webextension-mv2/build-legacy
packages/connect-examples/webextension-mv3/build
packages/connect-examples/webextension-mv3/build-legacy
packages/connect-examples/webextension-mv3-sw/build
- name: Upload connect-explorer webextension artifacts
uses: actions/upload-artifact@v4
with:
name: connect-explorer-webextension
path: |
packages/connect-explorer/build-webextension
methods:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: methods.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
run-webextension: true
build-overview: true
popup-close:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: popup-close.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
run-webextension: true
passphrase:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: passphrase.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
run-webextension: true
popup-pages:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: popup-pages.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
browser-support:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: browser-support.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
permissions:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: permissions.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
transport:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: transport.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
unchained:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-test-params.yml
with:
test-name: unchained.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz