-
Notifications
You must be signed in to change notification settings - Fork 67
164 lines (137 loc) · 3.88 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Compilation & tests
on:
workflow_dispatch:
push:
branches:
- main
- master
- develop
pull_request:
jobs:
job_build_release_plugin:
name: Build release plugin
strategy:
matrix:
include:
- sdk: "$NANOS_SDK"
name: "nanos"
- sdk: "$NANOX_SDK"
name: "nanox"
- sdk: "$NANOSP_SDK"
name: "nanosp"
- sdk: "$STAX_SDK"
name: "stax"
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
run: |
make BOLOS_SDK=${{ matrix.sdk }} -j
job_scan_build:
name: Clang Static Analyzer
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build with Clang Static Analyzer
run: |
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
- uses: actions/upload-artifact@v3
if: failure()
with:
name: scan-build
path: scan-build
job_build_debug_plugin:
name: Build debug plugin
strategy:
matrix:
include:
- sdk: "$NANOS_SDK"
name: "nanos"
- sdk: "$NANOX_SDK"
name: "nanox"
- sdk: "$NANOSP_SDK"
name: "nanosp"
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
run: |
make DEBUG=1 BOLOS_SDK=${{ matrix.sdk }} -j
- name: Rename binary
run: |
mv bin/app.elf plugin_${{ matrix.name }}.elf
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binaries
path: plugin_${{ matrix.name }}.elf
job_build_debug_app:
name: Build debug Ethereum app
strategy:
matrix:
include:
- sdk: "$NANOS_SDK"
name: "nanos"
- sdk: "$NANOX_SDK"
name: "nanox"
- sdk: "$NANOSP_SDK"
name: "nanosp"
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
steps:
- name: Checkout app-ethereum
uses: actions/checkout@v3
with:
repository: LedgerHQ/app-ethereum
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
- name: Build
run: |
make DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=${{ matrix.sdk }} -j
- name: Rename binary
run: |
mv bin/app.elf ethereum_${{ matrix.name }}.elf
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binaries
path: ethereum_${{ matrix.name }}.elf
jobs-e2e-tests:
name: E2E Tests
needs: [job_build_debug_plugin, job_build_debug_app]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download built binaries
uses: actions/download-artifact@v3
with:
name: binaries
path: tests/elfs/
- name: Install node
uses: actions/setup-node@v3
with:
node-version: "16.19.0"
- name: Install yarn
run: |
npm install -g yarn
- name: Install JS deps
run: |
cd tests && yarn install
- name: Run Zemu tests
run: |
cd tests && yarn test