forked from bitcoin-core/HWI
-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (152 loc) · 4.8 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches: ['**']
tags-ignore: ['**']
concurrency:
group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
cancel-in-progress: true
env:
LC_ALL: 'C.UTF-8'
LANG: 'C.UTF-8'
LANGUAGE: 'C.UTF-8'
jobs:
type-check:
name: Type check
runs-on: ubuntu-latest
container: python:latest
steps:
- uses: actions/checkout@v4
- run: |
pip install poetry
poetry install
- name: Run check
run: >
poetry run
mypy
hwi.py
hwilib/_base58.py
hwilib/_bech32.py
hwilib/_cli.py
hwilib/commands.py
hwilib/common.py
hwilib/descriptor.py
hwilib/devices/__init__.py
hwilib/devices/keepkey.py
hwilib/devices/ledger.py
hwilib/devices/trezor.py
hwilib/errors.py
hwilib/_script.py
hwilib/_serialize.py
hwilib/tx.py
hwilib/hwwclient.py
hwilib/__init__.py
hwilib/key.py
hwilib/udevinstaller.py
lint:
name: lint
runs-on: ubuntu-latest
container: python:latest
steps:
- uses: actions/checkout@v4
- run: |
pip install poetry
poetry install
- run: |
poetry run flake8
wine-builder:
name: Wine builder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/build-push-action@v5
with:
context: .
file: contrib/build-wine.Dockerfile
tags: build-wine-container
load: true
- run: >
docker run --rm \
--volume ${{ github.workspace }}:${{ github.workspace }} \
--workdir ${{ github.workspace }} \
build-wine-container bash -c "
git config --global --add safe.directory ${{ github.workspace }}
contrib/build_wine.sh
find dist -type f -exec sha256sum {} \;
"
dist-builder:
name: Dist builder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/build-push-action@v5
with:
context: .
file: contrib/build.Dockerfile
tags: build-container
load: true
- run: >
docker run --rm \
--volume ${{ github.workspace }}:${{ github.workspace }} \
--workdir ${{ github.workspace }} \
build-container bash -c "
git config --global --add safe.directory ${{ github.workspace }}
contrib/build_bin.sh
contrib/build_dist.sh
find dist -type f -exec sha256sum {} \;
"
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
sim-builder:
name: Sim builder
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
device:
- { name: 'trezor-1', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' }
- { name: 'trezor-t', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' }
- { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' }
- { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' }
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build
pip install poetry
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip
sudo unzip protoc-22.0-linux-x86_64.zip -d /usr/local
protoc --version
- name: Build simulator
run: |
git config --global user.email "ci@ci.com"
git config --global user.name "ci"
cd test; ./setup_environment.sh --${{ matrix.device.name }}; cd ..
tar -czf ${{ matrix.device.archive }}.tar.gz ${{ matrix.device.paths }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.device.name }}-sim
path: ${{ matrix.device.archive }}.tar.gz
ledger-app-builder:
name: Ledger App builder
runs-on: ubuntu-latest
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
steps:
- run: |
git clone https://github.com/LedgerHQ/app-groestlcoin.git
cd app-groestlcoin
make DEBUG=1
- uses: actions/upload-artifact@v4
with:
name: ledger_app
path: app-groestlcoin/bin/app.elf
groestlcoind-builder:
name: groestlcoind builder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-groestlcoind