Skip to content

Commit

Permalink
ci: use build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nmammeri committed Jul 3, 2024
1 parent 2262066 commit e5acda0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 50 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e -x

cd bindings/python

curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
rustup default 1.78.0

free -h
cargo build --jobs 1 --config net.git-fetch-with-cli=true

for PYBIN in /opt/python/cp3[891]*/bin; do
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" build -F python -i "${PYBIN}/python" --release
done

for wheel in target/wheels/*.whl; do
auditwheel repair "${wheel}"
done
57 changes: 7 additions & 50 deletions .github/workflows/release_pyton_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
Expand All @@ -19,78 +18,38 @@ permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
#- runner: ubuntu-latest
# target: x86
- runner: ubuntu-latest
target: aarch64
#- runner: ubuntu-latest
# target: armv7
# NOT SUPPORTED with zig
#- runner: ubuntu-latest
# target: s390x
#- runner: ubuntu-latest
# target: ppc64le
linux-x86_64:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: graalvm/[email protected]
with:
java-version: '22'
distribution: 'graalvm-community'
set-java-home: 'true'
- name: Example step
- name: Graalvm check step
run: |
uname -a
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
working-directory: "bindings/python"
args: --release --out dist
sccache: 'true'
manylinux: auto
before-script-linux: ../../.github/workflows/install-graalvm-linux.sh
run: |
bash .github/workflows/build-wheels.sh
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
name: wheels-linux-x86_64
path: bindings/python/dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
shell: bash
run: |
set -e
pip install extract-rs --find-links dist --force-reinstall
pip install pytest
pytest
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
uses: uraimo/[email protected]
with:
arch: ${{ matrix.platform.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip pytest
run: |
set -e
pip3 install extract-rs --find-links dist --force-reinstall
pytest
windows:
runs-on: ${{ matrix.platform.runner }}
Expand All @@ -99,8 +58,6 @@ jobs:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down

0 comments on commit e5acda0

Please sign in to comment.