This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 261
80 lines (78 loc) · 2.46 KB
/
test_with_trezor-user-env.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
name: Test with trezor-user-env
on:
workflow_call:
inputs:
methods:
description: "List of methods to include in tests (example applySettings,applyFlags,getFeatures)"
type: "string"
required: false
test-pattern:
description: "Test pattern to use (e.g. `init` or `methods`)"
type: "string"
required: true
jobs:
test-nodejs:
name: Test NodeJS (${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
services:
trezor-user-env:
image: "ghcr.io/trezor/trezor-user-env:1d12b626fdd4aab4b5c8e148e42a81c269e7e5b5"
ports:
- 9001:9001
- 21326:21326
- 21325:21326
env:
SDL_VIDEODRIVER: "dummy"
USE_TX_CACHE: true
USE_WS_CACHE: true
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: "**/yarn.lock"
- run: yarn install
# Use `-d` to disable Docker, since it's started under `trezor-user-env`
- run: ./tests/run.sh -d -s 'yarn test:integration ${{ inputs.test-pattern }}' -i '${{ inputs.methods }}'
test-karma:
name: Test Karma
runs-on: ubuntu-latest
services:
trezor-user-env:
image: "ghcr.io/trezor/trezor-user-env:1d12b626fdd4aab4b5c8e148e42a81c269e7e5b5"
ports:
- 9001:9001
- 21326:21326
- 21325:21326
env:
SDL_VIDEODRIVER: "dummy"
USE_TX_CACHE: true
USE_WS_CACHE: true
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
# karma tests are run in browser, so node version doesn't matter too much
node-version: 12.x
cache: yarn
cache-dependency-path: "**/yarn.lock"
- run: yarn install
- name: Retrieve build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifact
path: build
# xvfb is required to run karma
- run: sudo apt-get install xvfb
# Use `-d` to disable Docker, since it's started under `trezor-user-env`
- run: xvfb-run --auto-servernum ./tests/run.sh -d -s 'yarn test:karma:production ${{ inputs.test-pattern }}' -i '${{ inputs.methods }}'