From f32916298edf40a0c77e918deec8d8c94675ffe7 Mon Sep 17 00:00:00 2001 From: Djeex Date: Sat, 22 Aug 2026 10:48:29 +0200 Subject: [PATCH] CI workflow with smoke test --- .gitea/workflows/ci.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 42319ab..5c69a7f 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -19,27 +19,28 @@ jobs: run: | docker build -t adguard-cidre:ci . 2>&1 | tee build.log if grep -q "Building wheel for" build.log; then - echo "::warning::Une dépendance a compilé depuis les sources — vérifie la compatibilité Python/Alpine" + echo "::warning::A dependency was built from source — check Python/Alpine compatibility" fi - - name: Smoke test + - name: Smoke test (syntax check) run: | - set +e - timeout 10s docker run --rm adguard-cidre:ci python blocklist_scheduler.py - code=$? - set -e - if [ "$code" -eq 124 ]; then - echo "OK: le script tourne toujours après 10s (timeout normal)" - elif [ "$code" -ne 0 ]; then - echo "::error::Le script a crashé au démarrage (code $code)" - exit 1 - fi + docker run --rm --entrypoint python adguard-cidre:ci -c " + import ast + with open('blocklist_scheduler.py') as f: + source = f.read() + try: + ast.parse(source) + print('OK: syntax is valid') + except SyntaxError as e: + print(f'::error::Syntax error: {e}') + exit(1) + " - name: Check deprecation warnings run: | docker run --rm adguard-cidre:ci python -W error::DeprecationWarning -c "import blocklist_scheduler" 2>&1 | tee deprecation.log || true if grep -qi "deprecat" deprecation.log; then - echo "::warning::Avertissement de dépréciation détecté, voir logs" + echo "::warning::Deprecation warning detected, check logs" fi - name: Scan with Trivy (critical - blocking)