CI #1333
This file contains hidden or 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
name: CI | |
on: | |
push: | |
branches-ignore: | |
- "wip*" | |
tags: | |
- "v[0-9].*" | |
pull_request: | |
schedule: | |
# Daily at 5:33 | |
- cron: "33 5 * * *" | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
list: | |
runs-on: ubuntu-latest | |
outputs: | |
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: astral-sh/setup-uv@445689ea25e0de0a23313031f5fe577c74ae45a1 | |
with: | |
enable-cache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- id: noxenvs-matrix | |
run: | | |
echo >>$GITHUB_OUTPUT noxenvs=$( | |
uvx nox --list-sessions --json | jq '[.[].session]' | |
) | |
test: | |
needs: list | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y libenchant-2-dev | |
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs') | |
- name: Install dependencies | |
run: brew install enchant | |
if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs') | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
3.13 | |
3.13t | |
3.14 | |
3.14t | |
pypy3.9 | |
pypy3.10 | |
pypy3.11 | |
allow-prereleases: true | |
- uses: astral-sh/setup-uv@445689ea25e0de0a23313031f5fe577c74ae45a1 | |
with: | |
enable-cache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- name: Run nox | |
run: uvx nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }} # zizmor: ignore[template-injection] | |
manylinux: | |
needs: test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
3.13 | |
3.13t | |
3.14 | |
3.14t | |
pypy3.9 | |
pypy3.10 | |
pypy3.11 | |
allow-prereleases: true | |
- name: Build wheels | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t 3.14 3.14t pypy3.9 pypy3.10 pypy3.11' | |
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }}-${{ matrix.target }} | |
path: dist | |
musllinux: | |
needs: test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- aarch64-unknown-linux-musl | |
- i686-unknown-linux-musl | |
- x86_64-unknown-linux-musl | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
3.13 | |
3.13t | |
3.14 | |
3.14t | |
pypy3.9 | |
pypy3.10 | |
pypy3.11 | |
allow-prereleases: true | |
- name: Build wheels | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t 3.14 3.14t pypy3.9 pypy3.10 pypy3.11' | |
manylinux: musllinux_1_2 | |
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }}-${{ matrix.target }} | |
path: dist | |
windows: | |
needs: test | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x64, x86] # x86 is not supported by pypy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
3.13 | |
3.14 | |
${{ matrix.target == 'x64' && 'pypy3.9' || '' }} | |
${{ matrix.target == 'x64' && 'pypy3.10' || '' }} | |
allow-prereleases: true | |
architecture: ${{ matrix.target }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.14' --interpreter ${{ matrix.target == 'x64' && 'pypy3.9 pypy3.10' || '' }} | |
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }}-${{ matrix.target }} | |
path: dist | |
windows-arm: | |
needs: test | |
runs-on: windows-11-arm | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- aarch64-pc-windows-msvc | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
# Install each python version seperatly so that the paths can be passed to maturin. (otherwise finds pre-installed x64 versions) | |
- uses: actions/setup-python@v5 | |
id: cp311 | |
with: | |
python-version: 3.11 | |
allow-prereleases: true | |
architecture: arm64 | |
- uses: actions/setup-python@v5 | |
id: cp312 | |
with: | |
python-version: 3.12 | |
allow-prereleases: true | |
architecture: arm64 | |
- uses: actions/setup-python@v5 | |
id: cp313 | |
with: | |
python-version: 3.13 | |
allow-prereleases: true | |
architecture: arm64 | |
- uses: actions/setup-python@v5 | |
id: cp314 | |
with: | |
python-version: 3.14 | |
allow-prereleases: true | |
architecture: arm64 | |
# rust toolchain is not currently installed on windopws arm64 images: https://github.com/actions/partner-runner-images/issues/77 | |
- name: Setup rust | |
id: setup-rust | |
run: | | |
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe -OutFile .\rustup-init.exe | |
.\rustup-init.exe -y | |
Add-Content $env:GITHUB_PATH "$env:USERPROFILE\.cargo\bin" | |
- name: Build wheels | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ steps.cp311.outputs.python-path }} ${{ steps.cp312.outputs.python-path }} ${{ steps.cp313.outputs.python-path }} ${{ steps.cp314.outputs.python-path }} | |
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }}-${{ matrix.target }} | |
path: dist | |
# free-threaded and normal builds share a site-packages folder on Windows so | |
# we must build free-threaded separately | |
windows-free-threaded: | |
needs: test | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x64, x86] # x86 is not supported by pypy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.13t | |
3.14t | |
allow-prereleases: true | |
architecture: ${{ matrix.target }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter '3.13t 3.14t' | |
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }}-${{ matrix.target }}-free-threaded | |
path: dist | |
macos: | |
needs: test | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
3.13 | |
3.13t | |
3.14 | |
3.14t | |
pypy3.9 | |
pypy3.10 | |
pypy3.11 | |
allow-prereleases: true | |
- name: Build wheels | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t 3.14 3.14t pypy3.9 pypy3.10 pypy3.11' | |
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }}-${{ matrix.target }} | |
path: dist | |
sdist: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.13 | |
- name: Build an sdist | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
command: sdist | |
args: --out dist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ github.job }} | |
path: dist | |
release: | |
needs: | |
[manylinux, musllinux, windows, windows-arm, windows-free-threaded, macos] | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
environment: | |
name: PyPI | |
url: https://pypi.org/p/rpds-py | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3 | |
with: | |
command: upload | |
args: --non-interactive --skip-existing * | |
- name: Create a GitHub Release | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 | |
with: | |
files: | | |
* | |
generate_release_notes: true |