From a8844843a6751ae77697a731abffc50402cf008e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jan 2021 23:30:47 +0100 Subject: ci: Also build/publish 32-bit wheels (#26) Closes #25 --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61042a8..68e1a10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,8 +41,21 @@ jobs: strategy: fail-fast: false matrix: + rust-toolchain: [1.45, nightly] python-version: [3.6, 3.7, 3.8, 3.9] os: [ubuntu-latest, macos-latest, windows-latest] + architecture: [x86, x64] + exclude: + # Only build 32-bit for Windows + - os: macos-latest + architecture: x86 + - os: ubuntu-latest + architecture: x86 + # Only build on Rust 1.45 on Linux + - os: macos-latest + rust-toolchain: 1.45 + - os: windows-latest + rust-toolchain: 1.45 steps: - name: Checkout @@ -51,22 +64,35 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install poetry poetry install - - name: Install latest nightly + + - name: Set Rust target environment variable + run: bash ci/set-target.sh ${{ matrix.os }} ${{ matrix.architecture }} + shell: bash + + - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: ${{ matrix.rust-toolchain }} + target: ${{ env.ACTIONS_RUST_TARGET }} override: true - name: Build Python package - run: poetry run maturin develop --release + if: matrix.architecture == 'x86' + run: poetry run maturin build --target ${{ env.ACTIONS_RUST_TARGET }} + + - name: Build Python package + if: matrix.architecture != 'x86' + run: poetry run maturin develop - name: Run Python tests + if: matrix.architecture != 'x86' run: poetry run pytest -vv --color=yes python-publish: @@ -77,17 +103,31 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8, 3.9] os: [ubuntu-latest, macos-latest, windows-latest] + architecture: [x86, x64] + exclude: + # Only build 32-bit for Windows + - os: macos-latest + architecture: x86 + - os: ubuntu-latest + architecture: x86 + steps: - uses: actions/checkout@v1 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} + + - name: Set Rust target environment variable + run: bash ci/set-target.sh ${{ matrix.os }} ${{ matrix.architecture }} + shell: bash - name: Install latest nightly uses: actions-rs/toolchain@v1 with: toolchain: nightly + target: ${{ env.ACTIONS_RUST_TARGET }} override: true - name: Install dependencies @@ -96,7 +136,7 @@ jobs: pip install poetry poetry install - name: Build Python package - run: poetry run maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}} + run: poetry run maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}} --target ${{ env.ACTIONS_RUST_TARGET }} - name: List wheels if: matrix.os == 'windows-latest' -- cgit v1.2.3