Skip to content

Commit

Permalink
Build Linux wheels with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bmerry committed Mar 20, 2024
1 parent 4aea8b1 commit c2f539f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .ci/before_all_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e -u

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,25 @@ jobs:
run: pip install .
- name: Run Python tests
run: pytest -v -ra
linux-wheels:
needs: [pre-commit, python-tests, rust-tests]
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
python: [cp38, cp39, cp30, cp311, cp312, pp38, pp39, pp310]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
if: matrix.arch != 'x86_64'
- uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.python }}-manylinux*
uses: actions/upload-artifact@v4
with:
name: wheel_linux-${{ matrix.arch }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/Cargo.lock
/build
/target
/dist
/wheelhouse
*.egg-info
_lib.*.so
_lib.*.dylib
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ ignore_missing_imports = true

[tool.pytest.ini_options]
testpaths = "python/tests"

[tool.cibuildwheel]
build-frontend = "build"
test-command = "pip install -r {project}/requirements.txt && pytest -v -ra {project}"
[tool.cibuildwheel.linux]
environment = "PATH=$HOME/.cargo/bin:$PATH"
archs = ["aarch64", "x86_64"]
before-all = ".ci/before_all_linux.sh"

0 comments on commit c2f539f

Please sign in to comment.