Skip to content

Commit

Permalink
Update CI script and dependencies
Browse files Browse the repository at this point in the history
Merges: #7
  • Loading branch information
chrysn authored Jan 13, 2025
2 parents 087b6a8 + 7f10100 commit 00c10b8
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 93 deletions.
124 changes: 99 additions & 25 deletions .github/workflows/maturin.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# This file is autogenerated by maturin v1.5.1
# This file is autogenerated by maturin v1.8.1
# To update, run
#
# maturin generate-ci --platform all --pytest github
#
# and
#
# * remove the "Upload to GitHub release" step
# * remove the emscripten / pytest step -- this fails for reasons that are too
# hard to to debug right now
# * added --no-index to local package installation during pytest, and remove
# MacOS pytest (workaround for
# <https://github.com/PyO3/maturin/issues/1971#issuecomment-2177906051>).
#
# <https://github.com/PyO3/maturin/issues/1971#issuecomment-2177906051>)
# and from emscripten.
name: CI

on:
Expand All @@ -33,23 +30,23 @@ jobs:
strategy:
matrix:
platform:
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: armv7
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: s390x
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -67,12 +64,14 @@ jobs:
shell: bash
run: |
set -e
pip install cbor-diag --no-index --find-links dist --force-reinstall
python3 -m venv .venv
source .venv/bin/activate
pip install cbor-diag --find-links dist --force-reinstall
pip install pytest
pytest
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
uses: uraimo/run-on-arch-action@v2.5.0
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
distro: ubuntu22.04
Expand All @@ -86,6 +85,67 @@ jobs:
pip3 install cbor-diag --no-index --find-links dist --force-reinstall
pytest
musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-22.04
target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
options: -v ${{ github.workspace }}:/io -w /io
run: |
set -e
apk add py3-pip py3-virtualenv
python3 -m virtualenv .venv
source .venv/bin/activate
pip install cbor-diag --no-index --find-links dist --force-reinstall
pip install pytest
pytest
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
distro: alpine_latest
githubToken: ${{ github.token }}
install: |
apk add py3-virtualenv
run: |
set -e
python3 -m virtualenv .venv
source .venv/bin/activate
pip install pytest
pip install cbor-diag --find-links dist --force-reinstall
pytest
windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
Expand All @@ -99,7 +159,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -117,7 +177,9 @@ jobs:
shell: bash
run: |
set -e
pip install cbor-diag --no-index --find-links dist --force-reinstall
python3 -m venv .venv
source .venv/Scripts/activate
pip install cbor-diag --find-links dist --force-reinstall
pip install pytest
pytest
Expand All @@ -126,15 +188,15 @@ jobs:
strategy:
matrix:
platform:
- runner: macos-latest
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -152,7 +214,7 @@ jobs:
strategy:
matrix:
platform:
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: wasm32-unknown-emscripten
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -183,9 +245,6 @@ jobs:
with:
name: wasm-wheels
path: dist
- uses: actions/setup-node@v3
with:
node-version: '18'

sdist:
runs-on: ubuntu-latest
Expand All @@ -205,17 +264,32 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, emscripten, sdist]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, musllinux, windows, macos, emscripten, sdist]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'wheels-*/*'
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
wasm-wheels/*.whl
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
Loading

0 comments on commit 00c10b8

Please sign in to comment.