Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,45 @@ jobs:
if: matrix.platform == 'windows-latest'
run: .\build.bat test python

# Native/Rust-extension unit tests for the published fable-library package.
# These live in src/fable-library-py/tests and exercise hand-written sources
# (fable_library.core, .union, .util) only, so no F# transpilation is needed.
# Previously this ran in publish-pypi.yml, where a failure was only visible
# at release time and did not actually gate the publish.
test-fable-library-py:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12", "3.13", "3.14"]
runs-on: ${{ matrix.platform }}
env:
UV_LINK_MODE: copy

steps:
- uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Build extension and run tests
working-directory: ./src/fable-library-py
run: |
uv sync --frozen
uv run --frozen maturin develop --release
uv run --frozen pytest tests

# Separate build job for Rust (will run in parallel)
build-rust:
timeout-minutes: 75
Expand Down
41 changes: 4 additions & 37 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,43 +57,10 @@ jobs:
path: ./temp/fable-library-py
retention-days: 1

test:
needs: build-fable-library
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12", "3.13", "3.14"]
env:
UV_LINK_MODE: copy

steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install uv
uses: astral-sh/setup-uv@v8.2.0
- name: Download fable-library-py
uses: actions/download-artifact@v8
with:
name: fable-library-py
path: ./src/fable-library-py
- name: Build and install
uses: PyO3/maturin-action@v1
with:
working-directory: ./src/fable-library-py
args: --release --features=pyo3/extension-module
- name: Test
run: |
cd src/fable-library-py
uv sync
uv run maturin develop --release
uv run pytest tests
# NOTE: the fable-library-py native test suite (src/fable-library-py/tests)
# runs in build.yml on every push/PR to main. It used to run here too, but
# it was never in `release`'s `needs`, so it gated nothing and only
# consumed runners the wheel jobs were queuing behind.

linux:
needs: build-fable-library
Expand Down
Loading