62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
name: Validate
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install Python test dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install --index-url https://download.pytorch.org/whl/cpu "torch>=2.5,<3"
|
|
python -m pip install "numpy>=1.26,<3" "Pillow>=10,<13" "jsonschema>=4.20,<5"
|
|
|
|
- name: Validate Python syntax
|
|
run: python -m compileall -q __init__.py py
|
|
|
|
- name: Run Python tests
|
|
run: python -m unittest discover -s tests -v
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
cache-dependency-path: ui/package-lock.json
|
|
|
|
- name: Install UI dependencies
|
|
working-directory: ui
|
|
run: npm ci
|
|
|
|
- name: Run frontend behavior tests
|
|
working-directory: ui
|
|
run: npm test
|
|
|
|
- name: Type-check UI
|
|
working-directory: ui
|
|
run: npm run typecheck
|
|
|
|
- name: Build UI
|
|
working-directory: ui
|
|
run: npm run build
|
|
|
|
- name: Verify committed UI bundle
|
|
run: git diff --exit-code -- js/bv_nodepack.core.js
|