From 761f296ffd63a00eb997a16c493b4138a59d71cd Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Mon, 2 Feb 2026 04:20:33 +0000 Subject: [PATCH] fix: add error handling for test step --- .gitea/workflows/ci.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index ebb9b99..3da7eee 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -11,17 +11,23 @@ jobs: git clone https://${{ gitea.server }}/${{ gitea.repository }} . git checkout ${{ gitea.sha }} - - name: Python version - run: python3 --version - - - name: Install deps + - name: Install Python deps run: | - python3 -m pip install --upgrade pip - python3 -m pip install pytest ruff - python3 -m pip install -e ".[dev]" + python3 -m pip install --upgrade pip -q + python3 -m pip install pytest ruff -q - name: Run tests - run: python3 -m pytest tests/ -v --tb=short + run: | + set +e + python3 -m pytest tests/ -v --tb=short + TEST_EXIT=$? + set -e + if [ $TEST_EXIT -ne 0 ]; then + echo "Tests failed with exit code $TEST_EXIT" + exit $TEST_EXIT + fi + echo "Tests passed" - name: Run linting - run: python3 -m ruff check i18n_key_sync/ tests/ || true + run: | + python3 -m ruff check i18n_key_sync/ tests/ || echo "Linting had issues"