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
17 changes: 17 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ jobs:
run: |
echo "::notice::Versão ${{ steps.meta.outputs.local }} já publicada no PyPI. Skipping."

- name: Configure Git identity (for fixture commits)
if: steps.meta.outputs.should_publish == 'true'
run: |
git config --global user.email "ci@simplicio.dev"
git config --global user.name "Simplicio CI"
git config --global commit.gpgsign false

- name: Install package and pytest
if: steps.meta.outputs.should_publish == 'true'
run: |
python -m pip install -e .
python -m pip install pytest

- name: Run pytest before publishing
if: steps.meta.outputs.should_publish == 'true'
run: python -m pytest tests/python -q

- name: Build distributions
if: steps.meta.outputs.should_publish == 'true'
run: python -m build
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Python + Rust CI — pytest matrix for the Python package + cargo test
# (and a maturin build smoke check) for the optional Rust acceleration crate.
# Complements scaffold-self-check.yml (Node) and python-lint.yml (ruff).

name: Python + Rust CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

concurrency:
group: python-rust-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
python-tests:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git identity (for fixture commits)
run: |
git config --global user.email "ci@simplicio.dev"
git config --global user.name "Simplicio CI"
git config --global commit.gpgsign false

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install package and pytest
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest

- name: Run pytest
run: python -m pytest tests/python -q

rust-tests:
name: cargo test (PyO3 crate)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Cache cargo target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: cargo-${{ runner.os }}-${{ hashFiles('rust/Cargo.toml') }}

- name: cargo test
run: cargo test --manifest-path rust/Cargo.toml --release

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: maturin develop + native parity test
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e . maturin pytest
(cd rust && maturin develop --release)
python -m pytest tests/python/test_native.py -q
Loading