-
-
Notifications
You must be signed in to change notification settings - Fork 251
110 lines (100 loc) · 3.93 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
name: "[Test] suite-desktop e2e"
# this action builds a desktop version of Suite and runs basic test suite for it
# run only if there are changes in suite or related libs paths
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*"
jobs:
run-desktop-tests:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- TEST_FILE: "spawn-bridge"
CONTAINERS: "trezor-user-env-unix"
- TEST_FILE: "suite-guide"
CONTAINERS: "trezor-user-env-unix"
- TEST_FILE: "wallet-discovery"
CONTAINERS: "trezor-user-env-unix"
# - TEST_FILE: "cardano-discovery"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_FILE: "eap-modal"
# CONTAINERS: "trezor-user-env-unix"
- TEST_FILE: "electrum"
CONTAINERS: "trezor-user-env-unix electrum-regtest"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run and store git values for Currents
run: |
echo "COMMIT_MESSAGE=$(git show -s --pretty=%s)" >> $GITHUB_ENV
echo "COMMIT_EMAIL=$(git show -s --pretty=%ae)" >> $GITHUB_ENV
echo "COMMIT_AUTHOR=$(git show -s --pretty=%an)" >> $GITHUB_ENV
echo "COMMIT_SHA=$(git show -s --pretty=%H)" >> $GITHUB_ENV
echo "COMMIT_TIMESTAMP=$(git show -s --pretty=%ct)" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install deps and build libs
run: |
yarn install --immutable
yarn message-system-sign-config
yarn workspace @trezor/suite-data build:lib
yarn workspace @trezor/transport-bridge build:lib
- name: Build app.js for tests
run: |
yarn workspace @trezor/suite-desktop build:app
yarn workspace @trezor/suite-desktop build:ui
- name: Run e2e desktop tests
env:
GITHUB_WORKFLOW: ${{github.workflow}}
GITHUB_ACTION: true
GITHUB_EVENT_NAME: ${{github.event_name}}
GITHUB_RUN_ID: ${{github.run_id}}
GITHUB_RUN_ATTEMPT: ${{github.run_attempt}}
GITHUB_REPOSITORY: ${{github.repository}}
COMMIT_INFO_BRANCH: ${{github.head_ref}}
COMMIT_INFO_MESSAGE: ${{env.COMMIT_MESSAGE}}
COMMIT_INFO_EMAIL: ${{env.COMMIT_EMAIL}}
COMMIT_INFO_AUTHOR: ${{env.COMMIT_AUTHOR}}
COMMIT_INFO_SHA: ${{env.COMMIT_SHA}}
COMMIT_INFO_TIMESTAMP: ${{env.COMMIT_TIMESTAMP}}
COMMIT_INFO_REMOTE: ${{github.repository}}
CURRENTS_PROJECT_ID: 4ytF0E
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: pr-run-${{github.run_id}}
COMPOSE_FILE: ./docker/docker-compose.suite-desktop-ci.yml
TEST_FILE: ${{ matrix.TEST_FILE }}
run: |
docker compose pull
docker compose up -d ${{ matrix.CONTAINERS }}
docker compose run test-run
- name: cleanup
env:
COMPOSE_FILE: ./docker/docker-compose.suite-desktop-ci.yml
run: docker compose down
# TODO: currently only uploads trace.zip, figure out why screens are not uploaded
- name: Upload artifacts
if: ${{ ! cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-artifacts-${{ matrix.TEST_FILE }}
path: |
./packages/suite-desktop-core/e2e/test-results