bats feilaa myös!
ci-bats Bats tests FAILED
ci-cucumber Cucumber tests FAILED
CI / feature (push) Failing after 48s
CI / main (push) Has been skipped

This commit is contained in:
moilanik
2026-06-13 06:02:50 +03:00
parent 737b766a1f
commit b38103dbf4
+25 -7
View File
@@ -28,25 +28,43 @@ jobs:
path: .ci path: .ci
- name: Run bats tests - name: Run bats tests
continue-on-error: true id: bats-tests
shell: bash shell: bash
run: | run: |
mkdir -p "reports/${GITHUB_SHA:0:8}/bats" 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 set +e
if ls tests/*.bats 1> /dev/null 2>&1; then docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} /code/tests/*.bats \
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 > "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1
fi BATS_EXIT=$?
{
echo "<html><body><h1>Bats tests</h1><ul>"
for f in reports/${GITHUB_SHA:0:8}/bats/*; do
echo "<li><a href=\"$(basename $f)\">$(basename $f)</a></li>"
done
echo "</ul></body></html>"
} > "reports/${GITHUB_SHA:0:8}/bats/index.html"
echo "BATS_EXIT=${BATS_EXIT}" >> "${GITHUB_ENV}"
exit ${BATS_EXIT}
- name: Publish bats reports - name: Publish bats reports
if: always()
shell: bash shell: bash
run: | run: |
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/bats" bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/bats"
- name: Set bats commit status - name: Set bats commit status
if: always()
shell: bash shell: bash
run: | run: |
bash .ci/scripts/report-status.sh success \ if [ "${BATS_EXIT}" = "0" ]; then
"Bats tests" \ 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/" \ "https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/" \
ci-bats ci-bats