Deduplicate ci.yml from #795 #271
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request. | |
| pull_request: | |
| # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push. | |
| 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: | |
| non-device-tests: | |
| name: Non-device tests | |
| runs-on: ubuntu-latest | |
| container: python:3.12 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| pip install poetry | |
| poetry install | |
| - name: Run tests | |
| run: | | |
| cd test; poetry run ./run_tests.py; cd .. | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| container: python:3.12 | |
| 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@v6 | |
| 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@v6 | |
| 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/ | |
| prepare-sim-matrices: | |
| name: Prepare sim matrices | |
| uses: ./.github/workflows/prepare-sim-matrices.yml | |
| sim-builder-trezor: | |
| needs: prepare-sim-matrices | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: trezor | |
| include: ${{ needs.prepare-sim-matrices.outputs.trezor }} | |
| # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1 | |
| # binaries compatible with Debian Bookworm (glibc 2.36) Python containers. | |
| # Trezor T binaries don't need this. | |
| runs-on: ubuntu-22.04 | |
| coldcard-firmware-seed: | |
| name: Seed Coldcard firmware (once per run) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Clone Coldcard firmware (with submodules) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p test/work | |
| git clone --recursive https://github.com/Coldcard/firmware.git test/work/firmware | |
| git -C test/work/firmware submodule sync --recursive | |
| git -C test/work/firmware -c protocol.version=2 submodule update --init --recursive --jobs 8 | |
| - name: Apply HWI patch | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git -C test/work/firmware am ../../data/coldcard-multisig.patch | |
| - name: Upload seeded repo as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coldcard-firmware-src | |
| path: test/work/firmware | |
| # Keep defaults; artifact is only needed within this run | |
| # Use the coldcard-specialized builder (downloads the seeded artifact) | |
| sim-builder-coldcard: | |
| needs: [prepare-sim-matrices, coldcard-firmware-seed] | |
| uses: ./.github/workflows/sim-builder-coldcard.yml | |
| with: | |
| include: ${{ needs.prepare-sim-matrices.outputs.coldcard }} | |
| runs-on: ubuntu-22.04 | |
| sim-builder-bitbox: | |
| needs: prepare-sim-matrices | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: bitbox | |
| include: ${{ needs.prepare-sim-matrices.outputs.bitbox }} | |
| runs-on: ubuntu-latest | |
| sim-builder-jade: | |
| needs: prepare-sim-matrices | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: jade | |
| include: ${{ needs.prepare-sim-matrices.outputs.jade }} | |
| runs-on: ubuntu-latest | |
| sim-builder-ledger: | |
| needs: prepare-sim-matrices | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: ledger | |
| include: ${{ needs.prepare-sim-matrices.outputs.ledger }} | |
| runs-on: ubuntu-latest | |
| sim-builder-keepkey: | |
| needs: prepare-sim-matrices | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: keepkey | |
| include: ${{ needs.prepare-sim-matrices.outputs.keepkey }} | |
| runs-on: ubuntu-22.04 | |
| ledger-s-app-builder: | |
| uses: ./.github/workflows/ledger-app-builder.yml | |
| with: | |
| app: nano_s | |
| runs-on: ubuntu-latest | |
| ledger-x-app-builder: | |
| uses: ./.github/workflows/ledger-app-builder.yml | |
| with: | |
| app: nano_x | |
| runs-on: ubuntu-latest | |
| bitcoind-builder: | |
| name: bitcoind builder | |
| # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep binaries | |
| # compatible with Debian Bookworm (glibc 2.36) Python containers. | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-bitcoind | |
| test-trezor: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-trezor, bitcoind-builder, dist-builder] | |
| with: | |
| device: trezor | |
| runs-on: ubuntu-latest | |
| test-ledger-s: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-ledger, ledger-s-app-builder, bitcoind-builder, dist-builder] | |
| with: | |
| device: ledger-legacy | |
| runs-on: ubuntu-latest | |
| test-ledger-x: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-ledger, ledger-x-app-builder, bitcoind-builder, dist-builder] | |
| with: | |
| device: ledger | |
| runs-on: ubuntu-latest | |
| test-coldcard: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-coldcard, bitcoind-builder, dist-builder] | |
| with: | |
| device: coldcard | |
| runs-on: ubuntu-22.04 | |
| test-bitbox01: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-bitbox, bitcoind-builder, dist-builder] | |
| with: | |
| device: bitbox01 | |
| runs-on: ubuntu-latest | |
| test-bitbox02: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-bitbox, bitcoind-builder, dist-builder] | |
| with: | |
| device: bitbox02 | |
| runs-on: ubuntu-latest | |
| test-jade: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-jade, bitcoind-builder, dist-builder] | |
| with: | |
| device: jade | |
| runs-on: ubuntu-latest | |
| test-keepkey: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-keepkey, bitcoind-builder, dist-builder] | |
| with: | |
| device: keepkey | |
| runs-on: ubuntu-latest | |