-
Notifications
You must be signed in to change notification settings - Fork 23
103 lines (85 loc) · 2.82 KB
/
ci-workflow.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
name: Compilation & tests
on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:
jobs:
build_application:
name: Build application
uses: lightsail-network/ledger-app-workflows/.github/workflows/reusable_build.yml@master
with:
upload_app_binaries_artifact: compiled_app_binaries
# TODO: Zemu does not support 3.28.0 yet.
builder_tag: "3.27.0"
unit_tests:
name: Unit test
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder
steps:
- name: Clone
uses: actions/checkout@v3
- name: Install deps
run: |
apk add --update nodejs npm libbsd-dev
- name: Build unit tests
run: |
CTEST_OUTPUT_ON_FAILURE=1 make tests-unit
- name: Generate code coverage
run: |
cd tests_unit/
lcov --directory . -b "$(realpath build/)" --capture --initial -o coverage.base && \
lcov --rc lcov_branch_coverage=1 --directory . -b "$(realpath build/)" --capture -o coverage.capture && \
lcov --directory . -b "$(realpath build/)" --add-tracefile coverage.base --add-tracefile coverage.capture -o coverage.info && \
lcov --directory . -b "$(realpath build/)" --remove coverage.info '*/tests_unit/*' -o coverage.info && \
genhtml coverage.info -o coverage
- uses: actions/upload-artifact@v3
with:
name: code-coverage
path: tests_unit/coverage
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
files: ./tests_unit/coverage.info
flags: unittests
name: codecov-app-stellar
fail_ci_if_error: false
verbose: true
e2e_tests:
name: Stellar e2e tests
strategy:
matrix:
device: ["nanos", "nanox", "nanosp", "stax"]
fail-fast: false
needs:
- build_application
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Build common js
run: cd tests_common_js && npm install && npm run build
- name: Build/Install build js deps
run: cd tests_zemu && npm install
- name: Download app binaries
uses: actions/download-artifact@v4
with:
name: compiled_app_binaries
path: build
- name: Copy plugin
run: cp -r tests_zemu/plugin_elfs/* build/
- name: Run zemu tests
run: cd tests_zemu && npm run test -- -t "\(${{ matrix.device }}\)"
- name: Upload snapshots
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.device }}-zemu-snapshots
path: tests_zemu/snapshots-tmp/