ci: add QA workflows and tests for scraper and Vue UI #371
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the CI/QA wiring for the new Vue.js UI and aligns the project’s workflows with the patterns used in other openZIM projects (Mindtouch, freecodecamp). It also adds Prettier and ESLint to pre-commit and ensures Vitest is correctly wired with a minimal smoke test.
Changes
QA workflow split (
.github/workflows/QA.yaml)Rename the single
check-qajob into two jobs:check-scraper-qa: runs Black, Ruff, and Pyright on the Python scraper (same behavior as before).check-zimui-qa: new job for the Vue UI that:
ui/vianpm ci.ui/src (npx prettier --check src/).npm run lint.Tests workflow split (
.github/workflows/Tests.yaml)Split the monolithic tests into four jobs:
test-scraper: runs Python tests with coverage and uploads to Codecov (usingcodecov/codecov-action@v5).build-scraper: ensures the scraper can be built as sdist + wheel.build-and-test-zimui: new job for the Vue UI that:ui/vianpm ci.npm run test:unit.npm run build.build_docker: unchanged Docker image build + run check for the scraper image.Pre-commit configuration (
.pre-commit-config.yaml)Add Prettier mirror:
prettier hook targeting ui/ files (files:
ui\/.*$).Add ESLint mirror:
eslint hook targeting
ui/srcJS/TS/Vue files:files:
ui\/src\/.*(?:\.[jt]sx?|\.vue)$Uses
ui/.eslintrc.cjsas config.Keep existing Python hooks (pre-commit-hooks, Black, Ruff, Pyright) unchanged.
Vitest wiring (
ui/src/utils/__tests__/placeholder.test.ts)Convert the placeholder test into a minimal but valid Vitest suite:
Import
describe,it,expectfromvitest.Keep a simple “always true” test so the test pipeline is exercised.
Intention is to keep this as a temporary smoke test and add real unit tests in a follow‑up issue.
Fixes #362.