Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 62 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
id-token: write

jobs:
python:
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -23,24 +23,80 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: rigour-core
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libicu-dev
packages: libicu-dev pkg-config
version: 1.0
- name: Install dependencies
run: |
pip install -U pip maturin
pip install -e ".[dev]"
- name: Run the tests
run: |
make test
- name: Check type annotations (strict)
run: |
make typecheck
- name: Build a distribution

build-wheels:
name: Build wheels on ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
needs: test
strategy:
matrix:
platform:
- name: Linux
os: ubuntu-latest
target: x86_64
- name: macOS
os: macos-latest
target: universal2
steps:
- uses: actions/checkout@v6
- name: Install ICU (macOS)
if: runner.os == 'macOS'
run: |
python3 -m build --wheel
- name: Publish a Python distribution to PyPI
if: matrix.python == '3.12' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
brew install icu4c pkg-config
echo "PKG_CONFIG_PATH=$(brew --prefix icu4c)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "ICU_ROOT=$(brew --prefix icu4c)" >> $GITHUB_ENV
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out dist
sccache: 'true'
manylinux: auto
before-script-linux: |
# Install ICU and pkg-config in manylinux container
dnf install -y libicu-devel pkgconf-pkg-config
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform.name }}-${{ matrix.platform.target }}
path: dist

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [test, build-wheels]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
Loading
Loading