-
Notifications
You must be signed in to change notification settings - Fork 2
223 lines (192 loc) · 7.01 KB
/
build.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: Build & test apps
# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation.
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary.
#
# While this workflow is optional, having functional testing on your application is mandatory and this workflow and
# tooling environment is meant to be easy to use and adapt after forking your application
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build_app:
name: Build application
strategy:
matrix:
device: [nanos, nanosp, nanox, stax]
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:1d9f741e9bc969b072e2de53762b64993536c0f7
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
DEVICE_SDK="$(echo ${{ matrix.device }} | tr a-z A-Z)_SDK"
bash -c "make -C app BOLOS_SDK=\$${DEVICE_SDK}"
tar -C app/bin -czf app_${{ matrix.device }}.tgz .
bash -c "make -C app BOLOS_SDK=\$${DEVICE_SDK} DEBUG=1"
tar -C app/bin -czf app_${{ matrix.device }}_dbg.tgz .
- name: Upload
uses: actions/upload-artifact@v3
with:
path: app_${{ matrix.device }}.tgz
name: app_${{ matrix.device }}.tgz
- name: Upload (dbg)
uses: actions/upload-artifact@v3
with:
path: app_${{ matrix.device }}_dbg.tgz
name: app_${{ matrix.device }}_dbg.tgz
build_docker_integration_tests:
uses: ./.github/workflows/docker.yml
secrets: inherit
with:
dockerfile: docker/Dockerfile.integration-tests
image_name: integration_tests
build_docker_tezos_ocaml:
uses: ./.github/workflows/docker.yml
secrets: inherit
with:
dockerfile: docker/Dockerfile.ocaml
image_name: tezos_ocaml
integration_tests_basic:
needs: [build_app, build_docker_integration_tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
device: [nanos, nanosp, nanox, stax]
container:
image: ${{ needs.build_docker_integration_tests.outputs.image }}
credentials:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download app
uses: actions/download-artifact@v3
with:
name: app_${{ matrix.device }}.tgz
- name: Download app (dbg)
uses: actions/download-artifact@v3
with:
name: app_${{ matrix.device }}_dbg.tgz
- name: Run test
run: |
./tests/integration/run_test_local.sh -F -m ${{ matrix.device }} \
./tests/integration/${{ matrix.device }}
- name: Upload results
uses: actions/upload-artifact@v3
if: always()
with:
name: integration_tests_${{ matrix.device }}.json
path: ./integration_tests.json
generate_samples_unit_tests:
needs: [build_docker_tezos_ocaml]
runs-on: ubuntu-latest
container:
image: ${{ needs.build_docker_tezos_ocaml.outputs.image }}
credentials:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
options: -u root --entrypoint /bin/bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create dirs
run: |
mkdir -p tests/samples/micheline/nanos
mkdir -p tests/samples/operations/nanos
mkdir -p tests/samples/micheline/nanosp
mkdir -p tests/samples/operations/nanosp
mkdir -p tests/samples/micheline/nanox
mkdir -p tests/samples/operations/nanox
- name: Generate
run: |
export PATH=/home/opam/.opam/4.14/bin:$PATH
dune exec ./tests/generate/generate.exe micheline 500 \
nanos tests/samples/micheline
dune exec ./tests/generate/generate.exe operations 500 \
nanos tests/samples/operations
dune exec ./tests/generate/generate.exe micheline 500 \
nanosp tests/samples/micheline
dune exec ./tests/generate/generate.exe operations 500 \
nanosp tests/samples/operations \
dune exec ./tests/generate/generate.exe micheline 500 \
nanox tests/samples/micheline
dune exec ./tests/generate/generate.exe operations 500 \
nanox tests/samples/operations
- name: Unit tests
run: |
export PATH=/home/opam/.opam/4.14/bin:$PATH
make -C tests/unit
- name: Upload results (nanos, micheline)
uses: actions/upload-artifact@v3
with:
name: nanos_samples_micheline
path: tests/samples/micheline/nanos
- name: Upload results (nanos, operations)
uses: actions/upload-artifact@v3
with:
name: nanos_samples_operations
path: tests/samples/operations/nanos
- name: Upload results (nanosp, micheline)
uses: actions/upload-artifact@v3
with:
name: nanosp_samples_micheline
path: tests/samples/micheline/nanosp
- name: Upload results (nanosp, operations)
uses: actions/upload-artifact@v3
with:
name: nanosp_samples_operations
path: tests/samples/operations/nanosp
- name: Upload results (nanox, micheline)
uses: actions/upload-artifact@v3
with:
name: nanox_samples_micheline
path: tests/samples/micheline/nanox
- name: Upload results (nanox, operations)
uses: actions/upload-artifact@v3
with:
name: nanox_samples_operations
path: tests/samples/operations/nanox
integration_tests_samples:
needs: [build_app, generate_samples_unit_tests, build_docker_integration_tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
device: [nanos, nanosp, nanox]
type: [micheline, operations]
container:
image: ${{ needs.build_docker_integration_tests.outputs.image }}
credentials:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download app
uses: actions/download-artifact@v3
with:
name: app_${{ matrix.device }}.tgz
- name: Download app (dbg)
uses: actions/download-artifact@v3
with:
name: app_${{ matrix.device }}_dbg.tgz
- name: Download samples
uses: actions/download-artifact@v3
with:
name: ${{ matrix.device }}_samples_${{ matrix.type }}
path: tests
- name: Test
run: ./tests/integration/run_test_local.sh -T100 -F -m ${{ matrix.device }} tests
- name: Upload results
uses: actions/upload-artifact@v3
if: always()
with:
name: integration_tests_${{ matrix.type}}_${{ matrix.device }}.json
path: ./integration_tests.json