From 92696e91a460a6bd84ed29f7e9004d3e8dac63f3 Mon Sep 17 00:00:00 2001 From: moilanik Date: Sun, 14 Jun 2026 06:18:56 +0300 Subject: [PATCH] fix: propagate tool errors through quality gate + cucumber shell fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove bashcov from CI bats job (crashed on read-only fs, masked BATS_EXIT) - Remove stale bats-cov volume (no longer needed) - Add shell: bash to commit-status steps (sh doesn't support ${VAR:0:8}) - set +e first in bats step to catch all errors (docker pull, apk, etc.) - Tool error → BATS_EXIT != 0 → commit-status failure → PR merge blocked --- .gitea/workflows/quality-gate.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/quality-gate.yml b/.gitea/workflows/quality-gate.yml index e4c5469..6127b64 100644 --- a/.gitea/workflows/quality-gate.yml +++ b/.gitea/workflows/quality-gate.yml @@ -49,22 +49,16 @@ jobs: id: bats-tests shell: bash run: | - mkdir -p "reports/${GITHUB_SHA:0:8}/bats" - docker volume create bats-cov set +e + mkdir -p "reports/${GITHUB_SHA:0:8}/bats" docker run --rm \ -v "$(pwd):/repo:ro" \ - -v bats-cov:/coverage \ -v "$(pwd)/reports/${GITHUB_SHA:0:8}/bats:/reports" \ -w /repo \ - -e COVERAGE_DIR=/coverage \ --entrypoint bash ${{ inputs.bats-image }} \ -c 'apk add -q lsof python3 jq curl ruby && \ - gem install bashcov -v 3.3.0 2>&1 | tail -1 && \ - bashcov -- bats tests/ | tee /reports/results.txt' + bats tests/ | tee /reports/results.txt' BATS_EXIT=$? - bash .ci/.gitea/scripts/bats-coverage.sh bats-cov "reports/${GITHUB_SHA:0:8}/bats" || true - docker volume rm bats-cov > /dev/null 2>&1 bash .ci/.gitea/scripts/bats-report.sh "reports/${GITHUB_SHA:0:8}/bats" || true echo "BATS_EXIT=${BATS_EXIT}" >> "${GITHUB_ENV}" exit ${BATS_EXIT} @@ -75,6 +69,7 @@ jobs: - name: Set bats commit status if: always() + shell: bash run: | STATE="success" [ "${BATS_EXIT}" != "0" ] && STATE="failure" @@ -116,6 +111,7 @@ jobs: - name: Set cucumber commit status if: always() + shell: bash run: | STATE="success" [ "${CUCUMBER_EXIT}" != "0" ] && STATE="failure"