diff --git a/.github/workflows/tox.yaml b/.github/workflows/tox.yaml index 385e036900..2738480a78 100644 --- a/.github/workflows/tox.yaml +++ b/.github/workflows/tox.yaml @@ -22,7 +22,7 @@ concurrency: jobs: test: - name: Test (${{ matrix.jobtype }}, ${{ matrix.python-version}}, ${{ matrix.os }}) + name: Test (${{ matrix.jobtype }}, ${{ matrix.python-version}}, ${{ matrix.os }}, ${{ matrix.architecture }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -30,16 +30,53 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"] jobtype: [core, ens, integration-goethereum, integration-ethtester, lint, wheel] + architecture: [x64, x86] + exclude: + # Exclude x86 (32-bit) builds for macos, which doesn't support 32-bit at all + - os: macos-latest + architecture: x86 env: TOXENV: py${{ matrix.python-version }}-${{ matrix.jobtype }} TOX_RECREATE_FLAG: ${{ github.event_name == 'schedule' && '-r' || '' }} + IS_UBUNTU_32BIT: ${{ matrix.os == 'ubuntu-latest' && matrix.architecture == 'x86' }} steps: - uses: actions/checkout@v5 + # Use i386/python Docker for all 32-bit Ubuntu jobs (TODO cache some of this) + - name: Run job in 32-bit Ubuntu Docker container + if: ${{ env.IS_UBUNTU_32BIT == 'true' }} + uses: addnab/docker-run-action@v3 + with: + image: i386/python:${{ matrix.python-version }} + shell: bash + options: -v ${{ github.workspace }}:/workspace -w /workspace + run: | + python -m pip install --upgrade pip + python -m pip install tox + python -m tox -e ${{ env.TOXENV }} ${{ env.TOX_RECREATE_FLAG }} + # There are no prebuilt 32-bit freethreaded Python containers at the time of this commit, but + # we will keep these runners so they will activate on their own whenever such containers exist + continue-on-error: ${{ matrix.python-version == '3.13t' || matrix.python-version == '3.14t' }} + + # No architecture specified for MacOS + - name: Set up Python (macos) + if: ${{ matrix.os == 'macos-latest' }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: | + setup.py + pyproject.toml + tox.ini + + # All other builds (64-bit Linux, 32-bit and 64-bit Windows) - name: Set up Python - uses: actions/setup-python@v6 + if: ${{ matrix.os != 'macos-latest' && env.IS_UBUNTU_32BIT != 'true' }} + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} cache: pip cache-dependency-path: | pyproject.toml @@ -47,11 +84,13 @@ jobs: tox.ini - name: Upgrade pip and install tox + if: ${{ env.IS_UBUNTU_32BIT != 'true' }} run: | python -m pip install --upgrade pip python -m pip install tox - name: Cache tox environment and hypothesis examples + if: ${{ env.IS_UBUNTU_32BIT != 'true' }} uses: actions/cache@v4 with: path: | @@ -61,4 +100,5 @@ jobs: save-always: ${{ env.TOX_RECREATE_FLAG == '-r' }} - name: Run tox + if: ${{ env.IS_UBUNTU_32BIT != 'true' }} run: python -m tox run ${{ env.TOX_RECREATE_FLAG }}