From b38103dbf40950be03a182b71479aa4f5495c043 Mon Sep 17 00:00:00 2001 From: moilanik Date: Sat, 13 Jun 2026 06:02:50 +0300 Subject: [PATCH] =?UTF-8?q?bats=20feilaa=20my=C3=B6s!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build-feature.yml | 32 +++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build-feature.yml b/.gitea/workflows/build-feature.yml index bf707c5..23274b8 100644 --- a/.gitea/workflows/build-feature.yml +++ b/.gitea/workflows/build-feature.yml @@ -28,25 +28,43 @@ jobs: path: .ci - name: Run bats tests - continue-on-error: true + id: bats-tests shell: bash run: | mkdir -p "reports/${GITHUB_SHA:0:8}/bats" - docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} /code/tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1 || true - if ls tests/*.bats 1> /dev/null 2>&1; then - docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} --formatter junit /code/tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/junit.xml" 2>&1 || true - fi + set +e + docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} /code/tests/*.bats \ + > "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1 + BATS_EXIT=$? + { + echo "

Bats tests

" + } > "reports/${GITHUB_SHA:0:8}/bats/index.html" + echo "BATS_EXIT=${BATS_EXIT}" >> "${GITHUB_ENV}" + exit ${BATS_EXIT} - name: Publish bats reports + if: always() shell: bash run: | bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/bats" - name: Set bats commit status + if: always() shell: bash run: | - bash .ci/scripts/report-status.sh success \ - "Bats tests" \ + if [ "${BATS_EXIT}" = "0" ]; then + STATUS="success" + DESC="Bats tests" + else + STATUS="failure" + DESC="Bats tests FAILED" + fi + bash .ci/scripts/report-status.sh "$STATUS" \ + "$DESC" \ "https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/" \ ci-bats