Skip to content

ci: restrict docs deploy token exposure #68

ci: restrict docs deploy token exposure

ci: restrict docs deploy token exposure #68

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "0 2 * * 0"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
jobs:
lint:
name: Lint + Format
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --all-extras --group dev
- run: uv run ruff check src tests
- run: uv run ruff format --check src tests
typecheck:
name: Types (mypy strict)
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --all-extras --group dev
- run: uv run mypy
test:
name: Tests + Coverage
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: uv sync --all-extras --group dev
- run: uv run pytest --cov=wardline --cov-report=term-missing --cov-fail-under=90
self-hosting-scan:
name: Self-Hosting Scan (dogfood)
runs-on: ubuntu-latest
needs: test
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --all-extras --group dev
- name: Scan self -> SARIF
run: uv run wardline scan src/ --format sarif --output results.sarif
- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: wardline-self-hosting
network:
name: Live judge e2e (weekly)
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --all-extras --group dev
- name: Network tests
run: uv run pytest -m network -v
env:
WARDLINE_LIVE_ORACLE_REQUIRED: "1"
WARDLINE_OPENROUTER_API_KEY: ${{ secrets.WARDLINE_OPENROUTER_API_KEY }}
live-oracles:
name: Live ${{ matrix.name }} e2e (weekly/manual)
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
include:
- name: Clarion
marker: clarion_e2e
- name: Legis
marker: legis_e2e
- name: Filigree
marker: filigree_e2e
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --all-extras --group dev
- name: Run live oracle
run: uv run pytest -m ${{ matrix.marker }} -v
env:
WARDLINE_LIVE_ORACLE_REQUIRED: "1"
WARDLINE_CLARION_BIN: ${{ secrets.WARDLINE_CLARION_BIN }}
WARDLINE_LEGIS_URL: ${{ secrets.WARDLINE_LEGIS_URL }}
WARDLINE_FILIGREE_URL: ${{ secrets.WARDLINE_FILIGREE_URL }}
- name: Summarize live oracle
if: always()
run: |
{
echo "### Live ${{ matrix.name }} oracle"
echo "- Marker: \`${{ matrix.marker }}\`"
echo "- Trigger: \`${{ github.event_name }}\`"
echo "- Missing local services, secrets, or capabilities fail this required oracle run."
} >> "$GITHUB_STEP_SUMMARY"
docs-build:
name: Docs (build)
runs-on: ubuntu-latest
needs: test
if: github.event_name != 'schedule'
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --extra docs
- name: Build (strict)
run: uv run mkdocs build --strict
docs-deploy:
name: Docs (deploy)
runs-on: ubuntu-latest
needs: docs-build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
- run: uv sync --extra docs
- name: Deploy
run: uv run mkdocs gh-deploy --force