Repository navigation
ADFA-4739: Kotlin docs DB pipeline + Build Kotlin Docs GitHub Action #8
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: Python tests | |
| # Runs the repo's pytest suites on every push and PR. | |
| # | |
| # Added because nothing here executed them: the Kotlin-docs pipeline ships | |
| # ~1,300 lines of regression tests covering permanent, silent data-loss paths | |
| # (a migration deleting an unrelated page, an image optimizer collapsing two | |
| # sources onto one output, a chunk chain reassembling truncated), and until now | |
| # they only ran when someone remembered to run them locally. Tests that never | |
| # run in CI rot, and these are exactly the ones whose failure is invisible | |
| # without them. | |
| # | |
| # The suites are separate because their dependencies are: docdb-studio and | |
| # check-tools each own a pyproject.toml + uv.lock, while ProcessKotlinWebsiteJSON | |
| # runs against the root requirements.txt. | |
| # | |
| # check-tools is NOT run here, deliberately. Its suite covers the health checker | |
| # behind the daily docdb-regression-test.yaml cron and genuinely ought to be | |
| # wired up - but 6 of its 13 tests already fail on main | |
| # (test_db_health_checker.py: the checker reports no issues where the tests | |
| # expect one), in code this PR doesn't touch. Adding the step as-is would make | |
| # every PR red for an unrelated reason. Fixing those belongs in its own change; | |
| # adding the step is a one-liner once they pass: | |
| # - name: check-tools | |
| # working-directory: check-tools | |
| # run: uv run --frozen -- python -m pytest -q | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: python-tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| pytest: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -y | |
| # pngquant: optimize_media.py shells out to it, and its tests exercise | |
| # the real binary rather than mocking it. | |
| # brotli: the CLI, not the Python package - DictionaryCompressor uses | |
| # it because no Python binding exposes a custom dictionary. | |
| # zstd: train_dictionary uses `zstd --train-fastcover` to build the | |
| # shared dictionary the migration tests need. | |
| sudo apt-get install -y pngquant brotli zstd | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: 'ProcessKotlinWebsiteJSON + sync_kotlin_stdlib_docs' | |
| run: | | |
| uv run --with-requirements requirements.txt --with pytest -- \ | |
| python -m pytest \ | |
| ProcessDocs/ProcessKotlinDocs/ProcessKotlinWebsiteJSON \ | |
| scripts/sync_kotlin_stdlib_docs \ | |
| -q | |
| - name: docdb-studio | |
| working-directory: docdb-studio | |
| run: uv run --frozen -- python -m pytest -q | |