34 lines
1.3 KiB
YAML
34 lines
1.3 KiB
YAML
# Runs on Gitea Actions (reads .github/workflows) and GitHub Actions.
|
|
name: ci
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python: ["3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Install
|
|
# setup-uv >= 5.x already creates and activates .venv when python-version is set; --clear works either way
|
|
run: uv venv --clear && uv pip install -e ".[dev]"
|
|
- name: Lint
|
|
run: uv run ruff check src tests && uv run ruff format --check src tests
|
|
- name: Type check
|
|
run: uv run mypy
|
|
- name: Unit tests (no downloaded data needed)
|
|
run: uv run pytest tests/unit -q
|
|
- name: Build the compiled kernels (rust/simurg-core)
|
|
run: |
|
|
command -v cc >/dev/null || { apt-get update -qq && apt-get install -y -qq gcc >/dev/null; } # Rust needs a C linker
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
|
PATH="$HOME/.cargo/bin:$PATH" uv pip install ./rust/simurg-core
|
|
- name: Unit tests with the compiled kernels (must equal the pure-Python results)
|
|
run: uv run pytest tests/unit -q
|