diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3e7a20c..891ad6c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,6 +20,7 @@ concurrency: jobs: lint: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -37,6 +38,7 @@ jobs: zizmor: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -48,19 +50,16 @@ jobs: linux: runs-on: ${{ matrix.platform.runner }} + timeout-minutes: 30 strategy: matrix: platform: - runner: ubuntu-latest target: x86_64 - # DNS fails inside the i686 manylinux container on the ubuntu 26.04 - # runner image (maturin-action's libatomic install can't reach yum). - - runner: ubuntu-24.04 - target: x86 - # rust-numpy rejects free-threaded 3.14t on 32-bit targets, so - # list interpreters explicitly instead of --find-interpreter. - interpreters: -i python3.11 python3.12 python3.13 python3.14 python3.15 python3.15t pypy3.11 - - runner: ubuntu-latest + # Native arm64 runner: no cross-compile, and pytest runs without QEMU. + # Stay on 24.04: the manylinux2014 (CentOS 7) container can't + # resolve its yum mirrors on the 26.04 images. + - runner: ubuntu-24.04-arm target: aarch64 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -69,50 +68,47 @@ jobs: - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: 3.14 + # The maturin container downloads maturin from GitHub releases with an + # unretried curl | tar, which fails intermittently; retry the build once. - name: Build wheels + id: build + continue-on-error: true uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 - with: + with: &linux-build target: ${{ matrix.platform.target }} - args: --release --out dist ${{ matrix.platform.interpreters || '--find-interpreter' }} + maturin-version: v1.16.0 + args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: auto + - name: Build wheels (retry) + if: ${{ steps.build.outcome == 'failure' }} + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 + with: *linux-build - name: Upload wheels uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: wheels-linux-${{ matrix.platform.target }} path: dist + # x86_64 wheels are tested across interpreters by the pytest job. - name: pytest - if: ${{ !startsWith(matrix.platform.target, 'x86') }} - uses: uraimo/run-on-arch-action@1e2c619f81e6d8609845ea1d2f443a778df1ac68 # v3 - with: - arch: ${{ matrix.platform.target }} - distro: ubuntu24.04 - githubToken: ${{ github.token }} - install: | - apt-get update - apt-get install -y --no-install-recommends python3 python3-venv - run: | - set -e - python3 -m venv .venv - . .venv/bin/activate - pip install -U pip pytest - pip install "numpy>=2,<3" - pip install e57 --no-index --find-links dist --force-reinstall --no-deps - pytest + if: ${{ matrix.platform.target == 'aarch64' }} + run: | + set -e + python3 -m venv .venv + source .venv/bin/activate + pip install "numpy>=2,<3" pytest + pip install e57 --no-index --find-links dist --force-reinstall --no-deps + pytest musllinux: runs-on: ${{ matrix.platform.runner }} + timeout-minutes: 30 strategy: matrix: platform: - runner: ubuntu-latest target: x86_64 - - runner: ubuntu-latest - target: x86 - # rust-numpy rejects free-threaded 3.14t on 32-bit targets, so - # list interpreters explicitly instead of --find-interpreter. - interpreters: -i python3.11 python3.12 python3.13 python3.14 python3.15 python3.15t pypy3.11 pypy3.12 - - runner: ubuntu-latest + - runner: ubuntu-24.04-arm target: aarch64 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -122,37 +118,36 @@ jobs: with: python-version: 3.14 - name: Build wheels + id: build + continue-on-error: true uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 - with: + with: &musl-build target: ${{ matrix.platform.target }} - args: --release --out dist ${{ matrix.platform.interpreters || '--find-interpreter' }} + maturin-version: v1.16.0 + args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: musllinux_1_2 + - name: Build wheels (retry) + if: ${{ steps.build.outcome == 'failure' }} + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 + with: *musl-build - name: Upload wheels uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: wheels-musllinux-${{ matrix.platform.target }} path: dist + # The runner arch matches the target, so Alpine runs natively. - name: pytest - if: ${{ !startsWith(matrix.platform.target, 'x86') }} - uses: uraimo/run-on-arch-action@1e2c619f81e6d8609845ea1d2f443a778df1ac68 # v3 - with: - arch: ${{ matrix.platform.target }} - distro: alpine_latest - githubToken: ${{ github.token }} - install: | - apk add py3-virtualenv - run: | - set -e - python3 -m virtualenv .venv - source .venv/bin/activate - pip install pytest - pip install "numpy>=2,<3" - pip install e57 --no-index --find-links dist --force-reinstall --no-deps - pytest + run: | + docker run --rm -e PYTHONDONTWRITEBYTECODE=1 -v "$PWD":/io -w /io python:3.14-alpine sh -euc ' + pip install --root-user-action=ignore "numpy>=2,<3" pytest + pip install --root-user-action=ignore e57 --no-index --find-links dist --force-reinstall --no-deps + pytest -p no:cacheprovider + ' windows: runs-on: ${{ matrix.platform.runner }} + timeout-minutes: 30 strategy: matrix: platform: @@ -174,11 +169,18 @@ jobs: 3.15 architecture: ${{ matrix.platform.target }} - name: Build wheels + id: build + continue-on-error: true uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 - with: + with: &windows-build target: ${{ matrix.platform.target }} + maturin-version: v1.16.0 args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Build wheels (retry) + if: ${{ steps.build.outcome == 'failure' }} + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 + with: *windows-build - name: Upload wheels uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: @@ -196,11 +198,16 @@ jobs: pytest macos: + # macOS arm64 runners are capacity-constrained and jobs often go unassigned + # for 15 minutes and get cancelled. Don't let that fail PR runs; on main and + # tags it still fails the run, and attest/publish still gate on it. + continue-on-error: ${{ github.event_name == 'pull_request' }} runs-on: ${{ matrix.platform.runner }} + timeout-minutes: 30 strategy: matrix: platform: - - runner: macos-15 + - runner: macos-26 target: aarch64 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -215,11 +222,18 @@ jobs: 3.14 3.15 - name: Build wheels + id: build + continue-on-error: true uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 - with: + with: &macos-build target: ${{ matrix.platform.target }} + maturin-version: v1.16.0 args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Build wheels (retry) + if: ${{ steps.build.outcome == 'failure' }} + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 + with: *macos-build - name: Upload wheels uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: @@ -240,6 +254,7 @@ jobs: # the extension from source for every interpreter. needs: linux runs-on: ubuntu-latest + timeout-minutes: 15 strategy: fail-fast: false matrix: @@ -272,6 +287,7 @@ jobs: stubtest: needs: linux runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -294,6 +310,7 @@ jobs: ruff: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -308,6 +325,7 @@ jobs: sdist: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -326,6 +344,7 @@ jobs: attest: name: Attest runs-on: ubuntu-latest + timeout-minutes: 15 if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} needs: [lint, zizmor, ruff, linux, musllinux, windows, macos, sdist, pytest, stubtest] permissions: @@ -345,6 +364,7 @@ jobs: publish: name: Publish to PyPI runs-on: ubuntu-latest + timeout-minutes: 15 if: ${{ startsWith(github.ref, 'refs/tags/') }} needs: attest # PyPI's trusted publisher only accepts tokens from this environment, and