Deduplicate ci.yml from #795 #266
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/ | |
| # Individual sim builders (top-level jobs so tests can `needs` them) | |
| sim-builder-trezor: | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: 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 | |
| sim-builder-coldcard: | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: coldcard | |
| runs-on: ubuntu-22.04 | |
| sim-builder-bitbox: | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: bitbox | |
| runs-on: ubuntu-latest | |
| sim-builder-jade: | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: jade | |
| runs-on: ubuntu-latest | |
| sim-builder-ledger: | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: ledger | |
| runs-on: ubuntu-latest | |
| sim-builder-keepkey: | |
| uses: ./.github/workflows/sim-builder.yml | |
| with: | |
| sim: keepkey | |
| runs-on: ubuntu-22.04 | |
| # Ledger app builders must be top-level too (tests `needs` them) | |
| ledger-app-builder-s: | |
| uses: ./.github/workflows/ledger-app-builder.yml | |
| with: | |
| app: nano_s | |
| runs-on: ubuntu-latest | |
| ledger-app-builder-x: | |
| 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-app-builder-s, bitcoind-builder] | |
| with: | |
| device: ledger-legacy | |
| runs-on: ubuntu-latest | |
| test-ledger-x: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-ledger, ledger-app-builder-x, bitcoind-builder] | |
| with: | |
| device: ledger | |
| runs-on: ubuntu-latest | |
| test-coldcard: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-coldcard, bitcoind-builder] | |
| with: | |
| device: coldcard | |
| runs-on: ubuntu-22.04 | |
| test-bitbox01: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-bitbox, bitcoind-builder] | |
| with: | |
| device: bitbox01 | |
| runs-on: ubuntu-latest | |
| test-bitbox02: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-bitbox, bitcoind-builder] | |
| with: | |
| device: bitbox02 | |
| runs-on: ubuntu-latest | |
| test-jade: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-jade, bitcoind-builder] | |
| with: | |
| device: jade | |
| runs-on: ubuntu-latest | |
| test-keepkey: | |
| uses: ./.github/workflows/device-test.yml | |
| needs: [sim-builder-keepkey, bitcoind-builder] | |
| with: | |
| device: keepkey | |
| runs-on: ubuntu-latest | |