38 lines
929 B
YAML
38 lines
929 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
lint-and-build:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Python syntax check
|
|
run: |
|
|
python3 -m compileall -q collector web main.py
|
|
|
|
- name: Optional ruff lint
|
|
run: |
|
|
if command -v ruff >/dev/null 2>&1; then
|
|
ruff check collector web main.py || true
|
|
else
|
|
echo "ruff not installed, skipping"
|
|
fi
|
|
|
|
- name: Build venv (dry-run install)
|
|
run: |
|
|
python3 -m venv --system-site-packages .venv-ci
|
|
.venv-ci/bin/pip install --upgrade pip
|
|
.venv-ci/bin/pip install -r requirements.txt
|
|
.venv-ci/bin/python -c "import flask; print('flask', flask.__version__)"
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: rm -rf .venv-ci
|