-
-
Notifications
You must be signed in to change notification settings - Fork 251
106 lines (91 loc) · 3.15 KB
/
test-transport.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
name: "[Test] transport e2e"
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: [release/connect/**]
pull_request:
paths:
- "packages/transport/**"
- "packages/transport-bridge/**"
- "packages/transport-test/**"
- "packages/protobuf/**"
- "packages/protocol/**"
- "packages/trezor-user-env-link/**"
- "packages/utils/**"
- "docker/docker-compose.transport-test-ci.yml"
- "yarn.lock"
workflow_dispatch:
jobs:
transport-e2e-test:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- 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/transport-test
- name: Setup containers
run: |
docker compose -f ./docker/docker-compose.transport-test-ci.yml pull
docker compose -f ./docker/docker-compose.transport-test-ci.yml up -d
- name: Run E2E tests (old-bridge:emu)
run: yarn workspace @trezor/transport-test test:e2e:old-bridge:emu
- name: Run E2E tests (new-bridge:emu)
run: yarn workspace @trezor/transport-test test:e2e:new-bridge:emu
extract-branch:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Extract branch name
id: extract_branch
run: |
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
build-deploy:
needs: [extract-branch]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.extract-branch.outputs.branch }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
shell: bash
run: |
echo -e "\nenableScripts: false" >> .yarnrc.yml
yarn workspaces focus @trezor/transport -A
- name: Build transport tester
run: |
yarn workspace @trezor/transport-test build:e2e:api:browser
- 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: Upload transport tester
shell: bash
env:
DEPLOY_PATH: s3://dev.suite.sldev.cz/transport-test/${{ needs.extract-branch.outputs.branch }}
run: |
echo "DEPLOY_PATH is set to ${DEPLOY_PATH}"
mkdir -p tmp_build_directory
cp -R ./packages/transport-test/e2e/dist/* tmp_build_directory/
aws s3 sync --delete tmp_build_directory/ "${DEPLOY_PATH}"