forked from trezor/trezor-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (127 loc) · 5.61 KB
/
test-suite-desktop-e2e.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
name: "[Test] suite-desktop e2e"
# this workflow builds a desktop version of Suite and runs basic test suite for it
on:
pull_request:
branches:
- develop
paths-ignore:
- "suite-native/**"
- "packages/connect*/**"
- "packages/react-native-usb/**"
# ignore unrelated github workflows config files
- ".github/workflows/connect*"
- ".github/workflows/suite-native*"
- ".github/workflows/build-desktop*"
- ".github/workflows/release*"
- ".github/workflows/template*"
push:
branches:
- release/2*
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run-desktop-tests:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- TEST_GROUP: "@group=suite"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=device-management"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=settings"
CONTAINERS: "trezor-user-env-unix bitcoin-regtest"
# - TEST_GROUP: "@group=metadata"
# CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=passphrase"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=other"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=wallet"
CONTAINERS: "trezor-user-env-unix bitcoin-regtest"
steps:
- uses: actions/checkout@v4
- name: Check previous runs
id: check-previous-runs
if: github.event_name == 'pull_request' && github.run_attempt == 1
uses: './.github/actions/check-previous-test-runs'
with:
github_token: ${{ secrets.TREZOR_BOT_TOKEN }}
pr_branch: ${{ github.head_ref }}
repo: ${{ github.repository }}
workflow_name: ${{ github.workflow }}
job_name: "${{ github.job }} (${{ join(matrix.*, ', ') }})"
# Electron requires unprivileged user namespaces to function properly.
# Disabling this security rule allows Electron to create sandboxed processes
# without requiring elevated privileges, which is essential for running the application.
# This is workaround until electron builder solves this issue in future release.
- name: Disable security rule 'Restricted unprivileged user namespaces'
if: steps.check-previous-runs.outputs.skip_tests != 'true'
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Checkout
if: steps.check-previous-runs.outputs.skip_tests != 'true'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup node
if: steps.check-previous-runs.outputs.skip_tests != 'true'
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies, build libs and pull docker images
if: steps.check-previous-runs.outputs.skip_tests != 'true'
env:
COMPOSE_FILE: ./docker/docker-compose.suite-desktop-ci.yml
run: |
yarn install --immutable
yarn message-system-sign-config
yarn workspace @trezor/suite-data build:lib
yarn workspace @trezor/transport-bridge build:lib
docker compose pull ${{ matrix.CONTAINERS }}
- name: Build electron app.js for tests
if: steps.check-previous-runs.outputs.skip_tests != 'true'
run: |
yarn workspace @trezor/suite-desktop build:app
yarn workspace @trezor/suite-desktop build:ui
- name: Run Playwright e2e desktop tests
if: steps.check-previous-runs.outputs.skip_tests != 'true'
env:
COMPOSE_FILE: ./docker/docker-compose.suite-desktop-ci.yml
GITHUB_ACTION: true
CURRENTS_PROJECT_ID: 4ytF0E
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: pr-run-${{github.run_id}}
run: |
docker compose up -d ${{ matrix.CONTAINERS }}
echo "Starting Playwright Desktop test group ${{ matrix.TEST_GROUP }}"
yarn workspace @trezor/suite-desktop-core test:e2e:desktop --forbid-only --grep=${{ matrix.TEST_GROUP }}
- name: Extract Trezor-user-env and Regtest logs
if: ${{ !cancelled() && steps.check-previous-runs.outputs.skip_tests != 'true' }}
run: |
docker cp docker-trezor-user-env-unix-1:/trezor-user-env/logs/debugging.log trezor-user-env-debugging.log || true
docker cp docker-trezor-user-env-unix-1:/trezor-user-env/logs/emulator_bridge.log tenv-emulator-bridge-debugging.log || true
docker cp docker-trezor-user-env-unix-1:/trezor-user-env/docker/version.txt trezor-user-env-version.txt || true
docker logs docker-electrum-regtest-1 > electrum-regtest.txt || true
- name: Upload Trezor-user-env and Regtest logs
if: ${{ !cancelled() && steps.check-previous-runs.outputs.skip_tests != 'true' }}
uses: actions/upload-artifact@v4
with:
name: emulator-logs-${{ matrix.TEST_GROUP }}
path: |
trezor-user-env-debugging.log
tenv-emulator-bridge-debugging.log
trezor-user-env-version.txt
electrum-regtest.txt
retention-days: 30
- name: Docker compose down
if: steps.check-previous-runs.outputs.skip_tests != 'true'
env:
COMPOSE_FILE: ./docker/docker-compose.suite-desktop-ci.yml
run: docker compose down