name: CI
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
pull_request:
branches: [main, desarrollo]
jobs:
rust:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Check Rust formatting
run: cargo fmt --check
- name: Run Cargo Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Install cargo-audit
run: cargo install cargo-audit
- name: Run Cargo Audit
run: cargo audit
- name: Run Rust tests
env:
RUST_BACKTRACE: 1
run: cargo test --all-targets --verbose -- --nocapture
python:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
PYTHONIOENCODING: utf-8
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install pinned Rust toolchain
run: rustup show active-toolchain
- name: Install Python test dependencies
run: |
python -m pip install --upgrade pip "setuptools>=83.0.0"
python -m pip install -e .[dev]
python -m pip install bandit uv
- name: Check uv.lock is up to date
if: runner.os == 'Linux'
run: |
python -m pip install uv
uv lock --check
- name: Run Bandit
run: bandit -r python/tempus_ddb/
- name: Run pip-audit
shell: bash
run: |
python -m uv --quiet export --frozen --extra dev --no-emit-project --no-header --no-annotate --prune pip-audit -o requirements-audit.txt
# `python/` is a project directory, so pass the interpreter path explicitly.
python -m uv tool run --python "$(python -c 'import sys; print(sys.executable)')" pip-audit --disable-pip -r requirements-audit.txt
python -c "import pathlib; pathlib.Path('requirements-audit.txt').unlink(missing_ok=True)"
- name: Run Ruff
run: ruff check .
- name: Validate SPDX SBOM generation
run: |
python scripts/generate_sbom.py --version 0.5.4-ci --output artifacts/tempus-ddb.spdx.json
python -c "import json; d=json.load(open('artifacts/tempus-ddb.spdx.json', encoding='utf-8')); assert d['spdxVersion']=='SPDX-2.3' and d['packages']"
- name: Run Python tests
run: python -m pytest tests/ -vv --tb=long -ra
- name: Test CLI basic commands
run: |
tempus --version
tempus --help
tempus-github-executor --help
- name: Smoke test examples
run: |
python examples/basic_record.py
python examples/verify_chain.py
python examples/full_agent_flow.py