-
-
Notifications
You must be signed in to change notification settings - Fork 251
184 lines (170 loc) · 7.46 KB
/
test-connect.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
name: "[Test] connect core e2e"
# run only if there are changes in connect or related libs paths
on:
schedule:
# Runs at midnight UTC every day at 01:00 AM CET
- cron: "0 0 * * *"
push:
branches: [release/connect/**]
pull_request:
paths:
- "packages/blockchain-link/**"
- "packages/connect-common/**"
- "packages/connect-iframe/**"
- "packages/connect-web/**"
- "packages/connect/**"
- "packages/protobuf/**"
- "packages/schema-utils/**"
- "packages/transport/**"
- "packages/utils/**"
- "packages/utxo-lib/**"
- "docker/**"
- "submodules/trezor-common/**"
- "yarn.lock"
- ".github/workflows/test-connect.yml"
- ".github/workflows/template-connect-test-params.yml"
- "docker/docker-connect-test.sh"
- "docker/docker-compose.connect-test.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# todo: meaning of 'build' job is questionable. only 'web' tests use part of this jobs output
build:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
cache-dependency-path: "**/yarn.lock"
- run: |
echo -e "\nenableScripts: false" >> .yarnrc.yml
- run: yarn workspaces focus @trezor/connect-iframe @trezor/connect-web
- run: yarn workspace @trezor/connect-iframe build
- run: yarn workspace @trezor/connect-web build
# upload + download takes longer than doing yarn build:libs
- name: Upload build connect-web
uses: actions/upload-artifact@v4
with:
name: build-artifact-connect-web
path: packages/connect-web/build
- name: Upload build connect-iframe
uses: actions/upload-artifact@v4
with:
name: build-artifact-connect-iframe
path: packages/connect-iframe/build
set-matrix:
runs-on: ubuntu-latest
outputs:
dailyMatrix: ${{ steps.set-matrix-daily.outputs.dailyMatrix }}
otherDevicesMatrix: ${{ steps.set-matrix-other-devices.outputs.otherDevicesMatrix }}
allFwsMatrix: ${{ steps.set-matrix-all-firmwares.outputs.allFwsMatrix }}
modelOneMatrix: ${{ steps.set-matrix-model-one.outputs.modelOneMatrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set daily matrix
id: set-matrix-daily
run: echo "dailyMatrix=$(node ./scripts/ci/connect-test-matrix-generator.js --model=T2T1 --firmware=2-latest --env=all --groups=api,api-flaky --cache_tx=true --transport=Bridge)" >> $GITHUB_OUTPUT
- name: Set all firmwares matrix
id: set-matrix-all-firmwares
run: echo "allFwsMatrix=$(node ./scripts/ci/connect-test-matrix-generator.js --model=T2T1 --firmware=all --env=all --groups=all --cache_tx=false --transport=Bridge)" >> $GITHUB_OUTPUT
- name: Set other devices matrix
id: set-matrix-other-devices
run: echo "otherDevicesMatrix=$(node ./scripts/ci/connect-test-matrix-generator.js --model=all --firmware=2-main --env=node --groups=api --cache_tx=true --transport=Bridge)" >> $GITHUB_OUTPUT
- name: Set trezor model one matrix
id: set-matrix-model-one
run: echo "modelOneMatrix=$(node ./scripts/ci/connect-test-matrix-generator.js --model=T1B1 --firmware=1-latest --env=node --groups=api --cache_tx=true --transport=Bridge)" >> $GITHUB_OUTPUT
PR-check:
needs: [build, set-matrix]
name: PR-check ${{ matrix.key }}
if: github.repository == 'trezor/trezor-suite'
uses: ./.github/workflows/template-connect-test-params.yml
with:
testPattern: ${{ matrix.groups.pattern }}
includeFilter: ${{ matrix.groups.includeFilter }}
testsFirmware: ${{ matrix.firmware }}
testDescription: ${{ matrix.env }}-${{ matrix.groups.pattern }}-${{ matrix.groups.name }}
cache_tx: ${{ matrix.cache_tx }}
transport: ${{ matrix.transport }}
testEnv: ${{ matrix.env }}
testFirmwareModel: ${{ matrix.model }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.set-matrix.outputs.dailyMatrix) }}
randomized:
needs: [build, set-matrix]
name: randomized ${{ matrix.key }}
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.repository == 'trezor/trezor-suite'
uses: ./.github/workflows/template-connect-test-params.yml
with:
testPattern: ${{ matrix.groups.pattern }}
includeFilter: ${{ matrix.groups.includeFilter }}
testsFirmware: ${{ matrix.firmware }}
testDescription: ${{ matrix.env }}-${{ matrix.groups.pattern }}-${{ matrix.groups.name }}
cache_tx: ${{ matrix.cache_tx }}
transport: ${{ matrix.transport }}
testEnv: ${{ matrix.env }}
testFirmwareModel: ${{ matrix.model }}
testRandomizedOrder: true
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.set-matrix.outputs.dailyMatrix) }}
all-fws:
needs: [build, set-matrix]
name: all-fws ${{ matrix.key }} ${{ matrix.firmware }}
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.repository == 'trezor/trezor-suite'
uses: ./.github/workflows/template-connect-test-params.yml
with:
testPattern: ${{ matrix.groups.pattern }}
includeFilter: ${{ matrix.groups.includeFilter }}
testsFirmware: ${{ matrix.firmware }}
testDescription: ${{ matrix.firmware }}-${{ matrix.groups.pattern }}-${{ matrix.groups.name }}-${{ matrix.env }}
cache_tx: ${{ matrix.cache_tx }}
transport: ${{ matrix.transport }}
testEnv: ${{ matrix.env }}
testFirmwareModel: ${{ matrix.model }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.set-matrix.outputs.allFwsMatrix) }}
all-models-api:
needs: [build, set-matrix]
name: all-models-api ${{ matrix.key }}
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.repository == 'trezor/trezor-suite'
uses: ./.github/workflows/template-connect-test-params.yml
with:
testPattern: ${{ matrix.groups.pattern }}
includeFilter: ${{ matrix.groups.includeFilter }}
testsFirmware: ${{ matrix.firmware }}
testDescription: ${{ matrix.model }}-${{ matrix.firmware }}
cache_tx: ${{ matrix.cache_tx }}
transport: ${{ matrix.transport }}
testEnv: ${{ matrix.env }}
testFirmwareModel: ${{ matrix.model }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.set-matrix.outputs.otherDevicesMatrix) }}
model-one-api:
needs: [build, set-matrix]
name: model-one-api ${{ matrix.key }}
# if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.repository == 'trezor/trezor-suite'
uses: ./.github/workflows/template-connect-test-params.yml
with:
testPattern: ${{ matrix.groups.pattern }}
includeFilter: ${{ matrix.groups.includeFilter }}
testsFirmware: ${{ matrix.firmware }}
testDescription: ${{ matrix.model }}-${{ matrix.firmware }}
cache_tx: ${{ matrix.cache_tx }}
transport: ${{ matrix.transport }}
testEnv: ${{ matrix.env }}
testFirmwareModel: ${{ matrix.model }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.set-matrix.outputs.modelOneMatrix) }}