fix: stabilize gitea workflows
Deploy / Deploy Staging (push) Failing after 2s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 1s
Tests / lint (push) Failing after 1s

This commit is contained in:
Xiaoxia AI
2026-06-15 20:09:59 +08:00
parent f13c7ab9af
commit b9a95eea68
2 changed files with 22 additions and 32 deletions
+6 -16
View File
@@ -28,14 +28,9 @@ jobs:
shell: bash
run: |
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import shutil
root = Path('/var/lib/xiaoxia-saas-staging/repo')
if root.exists():
shutil.rmtree(root)
root.mkdir(parents=True, exist_ok=True)
PY
mkdir -p /var/lib/xiaoxia-saas-staging
rm -rf /var/lib/xiaoxia-saas-staging/repo
mkdir -p /var/lib/xiaoxia-saas-staging/repo
tar --exclude=.git -cf - . | tar -xf - -C /var/lib/xiaoxia-saas-staging/repo
- name: Verify staging env file
@@ -98,14 +93,9 @@ PY
shell: bash
run: |
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import shutil
root = Path('/var/lib/xiaoxia-saas-production/repo')
if root.exists():
shutil.rmtree(root)
root.mkdir(parents=True, exist_ok=True)
PY
mkdir -p /var/lib/xiaoxia-saas-production
rm -rf /var/lib/xiaoxia-saas-production/repo
mkdir -p /var/lib/xiaoxia-saas-production/repo
tar --exclude=.git -cf - . | tar -xf - -C /var/lib/xiaoxia-saas-production/repo
- name: Verify production env file
+16 -16
View File
@@ -22,19 +22,19 @@ jobs:
git -c http.https://api.xiaoxiajianji.com/.extraheader="$auth_header" fetch --depth=1 origin "$GITHUB_SHA"
git checkout --force FETCH_HEAD
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Show Python runtime
run: |
python3 --version
python3 -m pip --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt -r requirements-dev.txt
- name: Run tests
run: |
pytest tests/integration/ -v --cov=packages --cov=apps --cov-report=xml --cov-report=term
python3 -m pytest tests/integration/ -v --cov=packages --cov=apps --cov-report=xml --cov-report=term
lint:
runs-on: ubuntu-latest
@@ -51,24 +51,24 @@ jobs:
git -c http.https://api.xiaoxiajianji.com/.extraheader="$auth_header" fetch --depth=1 origin "$GITHUB_SHA"
git checkout --force FETCH_HEAD
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Show Python runtime
run: |
python3 --version
python3 -m pip --version
- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install black flake8 mypy
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt -r requirements-dev.txt
- name: Run Black (check only)
run: |
black --check packages/ apps/ tests/
python3 -m black --check packages/ apps/ tests/
- name: Run Flake8
run: |
flake8 packages/ apps/ tests/ --max-line-length=120 --extend-ignore=E203,W503
python3 -m flake8 packages/ apps/ tests/ --max-line-length=120 --extend-ignore=E203,W503
- name: Run MyPy
run: |
mypy packages/ apps/ --ignore-missing-imports
python3 -m mypy packages/ apps/ --ignore-missing-imports