-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from pyocd/maturin
Replace Milksnake by Maturin
- Loading branch information
Showing
14 changed files
with
1,913 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,45 +14,190 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
env: | ||
CIBW_ARCHS_LINUX: auto aarch64 | ||
CIBW_ARCHS_LINUX: auto # aarch64 | ||
CIBW_ARCHS_MACOS: x86_64 universal2 | ||
CIBW_ARCHS_WINDOWS: auto | ||
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:/usr/share/rust/.cargo/bin:$HOME/.cargo/bin"' | ||
CIBW_ENVIRONMENT_MACOS: 'PATH="$PATH:/usr/share/rust/.cargo/bin:$HOME/.cargo/bin"' | ||
CIBW_ENVIRONMENT_WINDOWS: 'RUSTFLAGS="-Ctarget-feature=+crt-static"' | ||
CIBW_SKIP: "cp27-* cp34-* cp35-* pp*" | ||
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel" | ||
CIBW_BEFORE_BUILD: "python -m pip install --upgrade pip wheel setuptools setuptools_scm" | ||
CIBW_BUILD: "cp39-*" | ||
CIBW_SKIP: "cp39-musl*" | ||
CIBW_BEFORE_ALL_LINUX: > | ||
yum install -y libffi-devel openssl-devel && | ||
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.63.0 --profile=minimal -y && | ||
rustup show && | ||
cargo install empty-library || true | ||
CIBW_BUILD_VERBOSITY: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Rust | ||
if: runner.os != 'Linux' | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
toolchain: 1.63.0 | ||
profile: minimal | ||
|
||
- name: Install Rust aarch64-apple-darwin target | ||
if: runner.os == 'macOS' | ||
run: rustup target add aarch64-apple-darwin | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: arm64 | ||
# - name: Set up QEMU | ||
# if: runner.os == 'Linux' | ||
# uses: docker/setup-qemu-action@v2 | ||
# with: | ||
# platforms: arm64,arm | ||
|
||
- uses: actions/setup-python@v2 | ||
- uses: actions/setup-python@v4 | ||
name: Install Python | ||
with: | ||
python-version: '3.7' | ||
python-version: 3.9 | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.1.3 | ||
uses: pypa/cibuildwheel@v2.11.2 | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
linux-armv6: | ||
name: Cross-build wheels for linux-armv6 | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.63.0 | ||
profile: minimal | ||
target: arm-unknown-linux-gnueabihf | ||
default: true | ||
- name: Install cross toolchain and build | ||
run: | | ||
brew tap messense/macos-cross-toolchains | ||
brew install arm-unknown-linux-gnueabihf | ||
export CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc | ||
export CXX_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-g++ | ||
export AR_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-ar | ||
export CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-unknown-linux-gnueabihf-gcc | ||
pip3 install maturin cffi | ||
maturin build --release --target arm-unknown-linux-gnueabihf --out wheelhouse | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
linux-armv7: | ||
name: Cross-build wheels for linux-armv7 | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.63.0 | ||
profile: minimal | ||
target: armv7-unknown-linux-gnueabihf | ||
default: true | ||
- name: Install cross toolchain and build | ||
run: | | ||
brew tap messense/macos-cross-toolchains | ||
brew install armv7-unknown-linux-gnueabihf | ||
export CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc | ||
export CXX_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-g++ | ||
export AR_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-ar | ||
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc | ||
pip3 install maturin cffi | ||
maturin build --release --target armv7-unknown-linux-gnueabihf --out wheelhouse | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
linux-aarch64: | ||
name: Cross-build wheels for linux-aarch64 | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.63.0 | ||
profile: minimal | ||
target: aarch64-unknown-linux-gnu | ||
default: true | ||
- name: Install cross toolchain and build | ||
run: | | ||
brew tap messense/macos-cross-toolchains | ||
brew install aarch64-unknown-linux-gnu | ||
export CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-gcc | ||
export CXX_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-g++ | ||
export AR_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-ar | ||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc | ||
pip3 install maturin cffi | ||
maturin build --release --target aarch64-unknown-linux-gnu --out wheelhouse | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
test-cross: | ||
name: Test cross-built wheels (${{ matrix.platform.arch }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- distro: ubuntu22.04 | ||
arch: aarch64 | ||
# - distro: bullseye | ||
# arch: armv7 | ||
- distro: bullseye | ||
arch: armv6 | ||
needs: [linux-armv6, linux-armv7, linux-aarch64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse | ||
- uses: uraimo/[email protected] | ||
name: Install built wheel | ||
with: | ||
arch: ${{ matrix.platform.arch }} | ||
distro: ${{ matrix.platform.distro }} | ||
githubToken: ${{ github.token }} | ||
install: | | ||
apt-get update | ||
apt-get install -y --no-install-recommends python3 python3-pip | ||
pip3 install -U pip | ||
run: | | ||
pip3 install -U 'appdirs>=1.4,<2.0' cffi 'pyyaml>=6.0,<7.0' 'pytest>=6.0' hypothesis jinja2 | ||
pip3 install cmsis-pack-manager --no-index --find-links ./wheelhouse | ||
rm -rf cmsis_pack_manager | ||
python3 -c "import cmsis_pack_manager" | ||
pytest --cache-clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.