name: CI
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
pull_request:
branches: [main]
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
with:
python-version: ${{ matrix.python-version }}
- 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 pip-audit
- name: Run Bandit
run: bandit -r python/tempus_ddb/
- name: Run pip-audit
run: pip-audit
- name: Run Ruff
run: ruff check .
- name: Validate SPDX SBOM generation
run: |
python scripts/generate_sbom.py --version 0.5.3-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