name: CI on: push: branches: [main] pull_request: branches: [main] jobs: lint-and-build: runs-on: self-hosted steps: - name: 检出代码 uses: https://gitea.com/actions/checkout@v4 - name: Python 语法检查 run: | python3 -m compileall -q collector web main.py - name: 构建 venv 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: 清理临时 venv if: always() run: rm -rf .venv-ci