chores: rename project; vulns audit; changelog and releases (#3) #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.12" | |
| # Stdlib-only, so it runs before any install to fail as fast as possible. | |
| - name: Changelog documents the declared version | |
| run: python scripts/check_changelog.py | |
| - run: pip install ruff | |
| - run: ruff check src scripts tests | |
| - run: ruff format --check src scripts tests | |
| audit: | |
| # Known-vulnerability scan of the runtime dependency surface against the PyPI | |
| # advisory database. Auditing the project (rather than a frozen env) resolves | |
| # dependencies fresh from pyproject.toml, so this reflects what an operator's | |
| # install actually gets — including newer versions our `>=` floors allow. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install pip-audit | |
| - name: Audit dependencies for known vulnerabilities | |
| run: pip-audit . | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install -e ".[dev]" | |
| - run: pytest tests/unit -q | |
| build-sync: | |
| # Fails if the committed single-file distributables drifted from src/. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install -e ".[dev]" | |
| - run: python scripts/build.py | |
| - name: Verify distributables are in sync with src/ | |
| run: git diff --exit-code open-webui/ | |
| integration-tests: | |
| # Live tests against real Tenki microVMs. Only run when the secret is present | |
| # (first-party pushes / manual dispatch); a no-op otherwise. | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install -e ".[dev]" | |
| - name: Run live integration tests (skips if no key) | |
| env: | |
| TENKI_API_KEY: ${{ secrets.TENKI_API_KEY }} | |
| TENKI_API_ENDPOINT: ${{ secrets.TENKI_API_ENDPOINT }} | |
| run: pytest tests/integration -q | |
| ci: | |
| # The single required status check for the branch ruleset. Requiring the jobs | |
| # individually would couple the ruleset to the unit-tests matrix: adding a | |
| # Python version yields a check nobody requires, and dropping one leaves a | |
| # required check that never reports, blocking every pull request until | |
| # someone edits the ruleset. Aggregating here keeps that a workflow concern. | |
| # | |
| # integration-tests is deliberately not a dependency: it doesn't run on pull | |
| # requests, and it no-ops without TENKI_API_KEY. | |
| needs: [lint, audit, unit-tests, build-sync] | |
| # Without always() this job would be skipped when a gate fails — and a | |
| # skipped check counts as passing, so failing CI would satisfy the ruleset. | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Assert every gate succeeded | |
| env: | |
| RESULTS: ${{ join(needs.*.result, ' ') }} | |
| run: | | |
| set -euo pipefail | |
| echo "gate results: ${RESULTS}" | |
| # An empty join means the dependency graph changed underneath us; | |
| # passing on no evidence would defeat the point of this job. | |
| if [ -z "${RESULTS}" ]; then | |
| echo "no gate results reported" >&2 | |
| exit 1 | |
| fi | |
| for result in ${RESULTS}; do | |
| if [ "${result}" != "success" ]; then | |
| echo "a required gate did not succeed" >&2 | |
| exit 1 | |
| fi | |
| done |