Skip to content

Commit 8959401

Browse files
committed
ci: combine dist and test jobs
1 parent 5d26fed commit 8959401

File tree

3 files changed

+22
-40
lines changed

3 files changed

+22
-40
lines changed

.github/actions/test-device/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
- name: Run tests
2424
shell: bash
2525
run: |
26-
cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.interface }} --device-only; cd ..
26+
cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.test.interface }} --device-only; cd ..
2727
2828
- if: failure()
2929
shell: bash

.github/actions/test-dist/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ runs:
1313
path: dist/
1414

1515
- name: Install (Wheel)
16-
if: matrix.script == 'Wheel'
16+
if: matrix.test.script == 'Wheel'
1717
shell: bash
1818
run: |
1919
pip install dist/*.whl
2020
2121
- name: Install (Sdist)
22-
if: matrix.script == 'Sdist'
22+
if: matrix.test.script == 'Sdist'
2323
shell: bash
2424
run: |
2525
pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*")
2626
2727
- name: Install (Bindist)
28-
if: matrix.script == 'Bindist'
28+
if: matrix.test.script == 'Bindist'
2929
shell: bash
3030
run: |
3131
poetry install; cd dist; tar -xvf hwi*linux*.tar.gz; cd ..
@@ -43,19 +43,19 @@ runs:
4343
device: ${{ matrix.device }}
4444

4545
- name: Run tests (Wheel)
46-
if: matrix.script == 'Wheel'
46+
if: matrix.test.script == 'Wheel'
4747
shell: bash
4848
run: |
4949
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
5050
5151
- name: Run tests (Sdist)
52-
if: matrix.script == 'Sdist'
52+
if: matrix.test.script == 'Sdist'
5353
shell: bash
5454
run: |
5555
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
5656
5757
- name: Run tests (Bindist)
58-
if: matrix.script == 'Bindist'
58+
if: matrix.test.script == 'Bindist'
5959
shell: bash
6060
run: |
6161
cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd ..

.github/workflows/ci.yml

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -272,35 +272,6 @@ jobs:
272272
- uses: actions/checkout@v4
273273
- uses: ./.github/actions/build-bitcoind
274274

275-
test-trezor-dist:
276-
name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script }}
277-
runs-on: ubuntu-latest
278-
needs:
279-
- dist-builder
280-
- sim-builder-trezor
281-
- bitcoind-builder
282-
283-
strategy:
284-
fail-fast: false
285-
matrix:
286-
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
287-
device:
288-
- 'trezor-1'
289-
- 'trezor-t'
290-
script:
291-
- 'Wheel'
292-
- 'Sdist'
293-
- 'Bindist'
294-
295-
env:
296-
DEVICE: '--${{ matrix.device }}'
297-
298-
container: python:${{ matrix.python-version }}
299-
300-
steps:
301-
- uses: actions/checkout@v4
302-
- uses: ./.github/actions/test-dist
303-
304275
test-coldcard-dist:
305276
name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }}
306277
runs-on: ubuntu-latest
@@ -444,9 +415,9 @@ jobs:
444415
- uses: ./.github/actions/test-dist
445416

446417
test-trezor:
447-
name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }}
418+
name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test }}
448419
runs-on: ubuntu-latest
449-
needs: [ sim-builder-trezor, bitcoind-builder ]
420+
needs: [ sim-builder-trezor, bitcoind-builder, dist-builder ]
450421
timeout-minutes: 45
451422

452423
strategy:
@@ -456,13 +427,24 @@ jobs:
456427
device:
457428
- 'trezor-1'
458429
- 'trezor-t'
459-
interface: [ 'library', 'cli', 'stdin' ]
430+
test:
431+
- {interface: 'library'}
432+
- {interface: 'cli'}
433+
- {interface: 'stdin'}
434+
- {script: 'Wheel'}
435+
- {script: 'Sdist'}
436+
- {script: 'Bindist'}
460437

461438
container: python:${{ matrix.python-version }}
462439

463440
steps:
464441
- uses: actions/checkout@v4
465-
- uses: ./.github/actions/test-device
442+
- name: run test
443+
if: ${{ matrix.test.interface }}
444+
uses: ./.github/actions/test-device
445+
- name: run dist test
446+
if: ${{ matrix.test.script }}
447+
uses: ./.github/actions/test-dist
466448

467449
test-ledger:
468450
name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }}

0 commit comments

Comments
 (0)