Skip to content

v0.15.0: install semantics & honest status (S0+S1) #193

v0.15.0: install semantics & honest status (S0+S1)

v0.15.0: install semantics & honest status (S0+S1) #193

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
PYTHONUTF8: "1" # Windows console defaults to cp1252 (charmap crashes on unicode output)
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml cryptography pytest pytest-cov ruff
pip install git+https://github.com/Capacium/capacium-models.git
pip install -e .
- name: Lint with ruff
run: python -m ruff check .
- name: Verify README release examples
run: |
python - <<'PY'
import pathlib
import re
pyproject = pathlib.Path("pyproject.toml").read_text()
match = re.search(r'^version\s*=\s*"([^"]+)"', pyproject, re.MULTILINE)
if not match:
print("Could not find project.version in pyproject.toml")
raise SystemExit(1)
version = match.group(1)
readme = pathlib.Path("README.md").read_text()
expected = {
f"git+https://github.com/Capacium/capacium.git@v{version}",
f"ghcr.io/capacium/cap:{version}",
}
missing = [needle for needle in expected if needle not in readme]
stale = sorted(set(re.findall(r"Capacium/capacium\.git@v\d+\.\d+\.\d+|ghcr\.io/capacium/cap:\d+\.\d+\.\d+", readme)))
stale = [value for value in stale if not value.endswith(f"v{version}") and not value.endswith(f":{version}")]
if missing or stale:
if missing:
print("README is missing current release references:")
for needle in missing:
print(f" - {needle}")
if stale:
print("README contains stale release references:")
for value in stale:
print(f" - {value}")
raise SystemExit(1)
PY
- name: Test with pytest
run: |
python -m pytest tests/ -v --tb=short --cov=src/capacium \
--ignore=tests/test_signing.py \
--ignore=tests/test_integration_phase0.py