Skip to content

Commit 03aba04

Browse files
committed
ci: split device groups
This ensures the failure to build a simulator for one device doesn't abort running jobs for the others. They're still grouped by manufacturer. Alternative to bitcoin-core#743.
1 parent 6c00725 commit 03aba04

File tree

4 files changed

+434
-86
lines changed

4 files changed

+434
-86
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build sim
2+
description: Build device simulator(s)
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Install dependencies
7+
shell: bash
8+
run: |
9+
sudo apt-get update
10+
sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build
11+
pip install poetry
12+
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip
13+
sudo unzip protoc-22.0-linux-x86_64.zip -d /usr/local
14+
protoc --version
15+
16+
- name: Build simulator
17+
shell: bash
18+
run: |
19+
git config --global user.email "[email protected]"
20+
git config --global user.name "ci"
21+
cd test; ./setup_environment.sh --${{ matrix.device.name }}; cd ..
22+
tar -czf ${{ matrix.device.archive }}.tar.gz ${{ matrix.device.paths }}
23+
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: ${{ matrix.device.name }}-sim
27+
path: ${{ matrix.device.archive }}.tar.gz
28+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test device
2+
description: Run tests for one device type.
3+
runs:
4+
using: composite
5+
steps:
6+
- shell: bash
7+
run: |
8+
pip install poetry
9+
poetry install
10+
11+
- uses: actions/download-artifact@v4
12+
with:
13+
name: bitcoind
14+
15+
- shell: bash
16+
run: |
17+
tar -xvf bitcoind.tar.gz
18+
19+
- uses: ./.github/actions/install-sim
20+
with:
21+
device: ${{ matrix.device }}
22+
23+
- name: Run tests
24+
shell: bash
25+
run: |
26+
cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.interface }} --device-only; cd ..
27+
28+
- if: failure()
29+
shell: bash
30+
run: |
31+
tail -v -n +1 test/*.std*
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Test dist
2+
description: Run dist tests for one device type.
3+
runs:
4+
using: composite
5+
steps:
6+
- shell: bash
7+
run: |
8+
pip install poetry
9+
10+
- uses: actions/download-artifact@v4
11+
with:
12+
name: dist
13+
path: dist/
14+
15+
- name: Install (Wheel)
16+
if: matrix.script == 'Wheel'
17+
shell: bash
18+
run: |
19+
pip install dist/*.whl'
20+
21+
- name: Install (Sdist)
22+
if: matrix.script == 'Sdist'
23+
shell: bash
24+
run: |
25+
pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*")
26+
27+
- name: Install (Bindist)
28+
if: matrix.script == 'Bindist'
29+
shell: bash
30+
run: |
31+
poetry install; cd dist; tar -xvf hwi*linux*.tar.gz; cd ..
32+
33+
- uses: actions/download-artifact@v4
34+
with:
35+
name: bitcoind
36+
37+
- shell: bash
38+
run: |
39+
tar -xvf bitcoind.tar.gz
40+
41+
- uses: ./.github/actions/install-sim
42+
with:
43+
device: ${{ matrix.device }}
44+
45+
- name: Run tests (Wheel)
46+
if: matrix.script == 'Wheel'
47+
shell: bash
48+
run: |
49+
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
50+
51+
- name: Run tests (Sdist)
52+
if: matrix.script == 'Sdist'
53+
shell: bash
54+
run: |
55+
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
56+
57+
- name: Run tests (Bindist)
58+
if: matrix.script == 'Bindist'
59+
shell: bash
60+
run: |
61+
cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd ..
62+
63+
- if: failure()
64+
shell: bash
65+
run: |
66+
tail -v -n +1 test/*.std*
67+

0 commit comments

Comments
 (0)