From dde49cf2ddf790f5fb9fc26025e5f3541cd148b9 Mon Sep 17 00:00:00 2001 From: Dash Date: Sat, 17 Oct 2026 19:16:02 +0200 Subject: [PATCH] build: run hooks and tests in GitHub Actions The lint job runs the prek hooks (ruff and ty) on all files. The test job runs pytest on Python 3.10 to 3.14 with node available, after fetching the web version's code for the upstream comparison; the download is cached, and if it fails those tests skip themselves. --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..679e46e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v6 + - run: uv sync + - run: uv run prek run --all-files --show-diff-on-failure + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v6 + with: + python-version: ${{ matrix.python }} + - uses: actions/setup-node@v4 + with: + node-version: 22 + - uses: actions/cache@v4 + with: + path: ~/.cache/pqcli/pq-web + key: pq-web-${{ hashFiles('tests/upstream/fetch.py') }} + # The upstream comparison tests skip themselves if this fails, for + # example while progressquest.com is down. + - run: uv run python tests/upstream/fetch.py || true + - run: uv run pytest -q