Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,35 @@ jobs:
- name: Run tests
run: pytest tests/ -v

test-musl:
name: Test (musllinux wheel on Alpine)
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build musllinux wheel
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist
manylinux: musllinux_1_2
# Alpine marks its system Python as externally managed (PEP 668), so the
# wheel is installed into a venv. --no-index is the real assertion here:
# if the wheel is not tagged musllinux, pip finds no candidate at all and
# the job fails, which is precisely the breakage being guarded against.
- name: Install wheel and run tests on Alpine
run: |
docker run --rm -v "$PWD:/io" -w /io alpine:latest sh -euc '
apk add --no-cache python3
python3 -m venv /venv
/venv/bin/pip install pytest
/venv/bin/pip install --no-index --find-links dist ormar-utils
/venv/bin/pytest tests/ -v
'

build:
name: Build wheels (${{ matrix.os }}-${{ matrix.target }})
needs: test
name: Build wheels (${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }})
needs: [test, test-musl]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -71,6 +97,15 @@ jobs:
target: x86_64
- os: ubuntu-latest
target: aarch64
# musl builds for Alpine and other musl-libc distros. glibc wheels are
# not installable there, so without these pip falls back to the sdist
# and requires a Rust toolchain on the target machine.
- os: ubuntu-latest
target: x86_64
manylinux: musllinux_1_2
- os: ubuntu-latest
target: aarch64
manylinux: musllinux_1_2
- os: macos-latest
target: x86_64
- os: macos-latest
Expand All @@ -89,11 +124,14 @@ jobs:
with:
target: ${{ matrix.target }}
args: --release --out dist
manylinux: auto
manylinux: ${{ matrix.manylinux || 'auto' }}
# The manylinux value is part of the name because the glibc and musl
# builds otherwise collide on os+target, and upload-artifact@v4 rejects
# duplicate artifact names.
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.target }}
name: wheels-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }}
path: dist

sdist:
Expand Down
Loading