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
7 changes: 5 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on:
- src/**
- python/**
- "*.toml"
- ".github/workflows/CI.yml"
- ".github/workflows/*.yml"
push:
branches: [main]
paths:
- src/**
- python/**
- "*.toml"
- ".github/workflows/CI.yml"
- ".github/workflows/*.yml"
workflow_dispatch:

permissions:
Expand All @@ -46,3 +46,6 @@ jobs:
sccache: 'true'
manylinux: auto
container: ${{ matrix.platform.container }}
test:
name: Run test
uses: ./.github/workflows/_test.yml
43 changes: 43 additions & 0 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Run Tests

on:
workflow_call:

env:
CARGO_TERM_COLOR: always

jobs:
rust:
strategy:
matrix:
python-version: [3.11, 3.13]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- run: rustup toolchain install stable --profile minimal
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
- name: Rust build
run: cargo build --verbose
- name: Rust tests
run: cargo test --verbose

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-pythonenv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pythonenv-${{ matrix.python-version }}-
- name: Python build & test
run: |
python -m venv .venv
source .venv/bin/activate
pip install maturin pytest
maturin develop
pytest python/cocoindex/tests
Loading