chore(deps): update rust crate cc to 1.2.8 (#240) #733
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 is autogenerated by maturin v1.3.2 | |
# To update, run | |
# | |
# maturin generate-ci -m pyapi/Cargo.toml github | |
# | |
name: Python Build | |
on: | |
push: | |
branches: [ "main", "next-major" ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ "main", "next-major" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build-test: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "build-test" | |
# - name: Install latest nextest release | |
# uses: taiki-e/install-action@nextest | |
- name: Cargo build | |
run: cargo build -p rustsat-pyapi --verbose | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: ${{ fromJSON('["", "4"]')[matrix.os == 'macos-latest'] }} | |
# - name: Run tests | |
# run: cargo nextest run --profile ci -p rustsat-pyapi --verbose | |
# env: | |
# CMAKE_BUILD_PARALLEL_LEVEL: ${{ fromJSON('["", "4"]')[matrix.os == 'macos-latest'] }} | |
- name: Build Python package | |
uses: PyO3/maturin-action@v1 | |
with: | |
args: -i python --manifest-path pyapi/Cargo.toml | |
- name: Install Python package | |
run: pip install --no-index --find-links target/wheels/ rustsat | |
- name: Test PyAPI example | |
run: python pyapi/examples/pyapi-dpw.py | |
version: | |
name: Ensure Python API crate version is in sync | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Check | |
run: "[ \"$(grep '^version = ' Cargo.toml)\" = \"$(grep '^version = ' pyapi/Cargo.toml)\" ]" | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --manifest-path pyapi/Cargo.toml | |
sccache: 'true' | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-${{ matrix.target }} | |
path: dist | |
pystubs: | |
name: Test python stubs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install maturin from PyPI | |
uses: install-pinned/maturin@1008b0b20e9cbc1b084334bd96f022734ce56e88 | |
- name: Install mypy from PyPI | |
uses: install-pinned/mypy@75779f141592e4909d64e13f8a1861f06aa9cd8d | |
- name: Install python project | |
run: maturin build -m pyapi/Cargo.toml && pip install --no-index --find-links target/wheels/ rustsat | |
- name: Test stubs | |
run: stubtest --mypy-config-file pyapi/pyproject.toml --allowlist pyapi/stubtest-allowlist.txt rustsat | |
windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
target: [x64, x86] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
architecture: ${{ matrix.target }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --manifest-path pyapi/Cargo.toml | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-windows-${{ matrix.target }} | |
path: dist | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --manifest-path pyapi/Cargo.toml | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-${{ matrix.target }} | |
path: dist | |
sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
maturin-version: '1.6.0' | |
command: sdist | |
args: --out dist --manifest-path pyapi/Cargo.toml | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-sdist | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/rustsat-v')" | |
needs: [linux, windows, macos, sdist] | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --non-interactive --skip-existing wheels-*/* |