jee
ci-bats Bats tests FAILED
ci-cucumber Cucumber tests FAILED
CI / feature (push) Failing after 46s
CI / main (push) Has been skipped

This commit is contained in:
moilanik
2026-06-13 06:16:51 +03:00
parent b38103dbf4
commit 9ba26dfdef
+37 -13
View File
@@ -27,7 +27,15 @@ jobs:
repository: niko/gitea-ci-library repository: niko/gitea-ci-library
path: .ci path: .ci
- name: Prepare bats
id: prepare-bats
shell: bash
run: |
docker run --rm ${{ inputs.bats-image }} --help
echo "TOOL_OK=true" >> "${GITHUB_ENV}"
- name: Run bats tests - name: Run bats tests
if: env.TOOL_OK == 'true'
id: bats-tests id: bats-tests
shell: bash shell: bash
run: | run: |
@@ -39,7 +47,9 @@ jobs:
{ {
echo "<html><body><h1>Bats tests</h1><ul>" echo "<html><body><h1>Bats tests</h1><ul>"
for f in reports/${GITHUB_SHA:0:8}/bats/*; do for f in reports/${GITHUB_SHA:0:8}/bats/*; do
echo "<li><a href=\"$(basename $f)\">$(basename $f)</a></li>" b="$(basename $f)"
[ "$b" = "index.html" ] && continue
echo "<li><a href=\"$b\">$b</a></li>"
done done
echo "</ul></body></html>" echo "</ul></body></html>"
} > "reports/${GITHUB_SHA:0:8}/bats/index.html" } > "reports/${GITHUB_SHA:0:8}/bats/index.html"
@@ -47,7 +57,7 @@ jobs:
exit ${BATS_EXIT} exit ${BATS_EXIT}
- name: Publish bats reports - name: Publish bats reports
if: always() if: env.TOOL_OK == 'true'
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"
@@ -56,17 +66,20 @@ jobs:
if: always() if: always()
shell: bash shell: bash
run: | run: |
if [ "${BATS_EXIT}" = "0" ]; then if [ "${TOOL_OK}" != "true" ]; then
STATUS="failure"
DESC="Bats tool unavailable"
URL="https://gitea.app.keskikuja.site/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
elif [ "${BATS_EXIT}" = "0" ]; then
STATUS="success" STATUS="success"
DESC="Bats tests" DESC="Bats tests"
URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/"
else else
STATUS="failure" STATUS="failure"
DESC="Bats tests FAILED" DESC="Bats tests FAILED"
URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/"
fi fi
bash .ci/scripts/report-status.sh "$STATUS" \ bash .ci/scripts/report-status.sh "$STATUS" "$DESC" "$URL" ci-bats
"$DESC" \
"https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/" \
ci-bats
cucumber: cucumber:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -85,7 +98,15 @@ jobs:
repository: niko/gitea-ci-library repository: niko/gitea-ci-library
path: .ci path: .ci
- name: Prepare cucumber
id: prepare-cucumber
shell: bash
run: |
npx --package @cucumber/cucumber cucumber-js --help
echo "TOOL_OK=true" >> "${GITHUB_ENV}"
- name: Run cucumber tests - name: Run cucumber tests
if: env.TOOL_OK == 'true'
id: cucumber-tests id: cucumber-tests
shell: bash shell: bash
run: | run: |
@@ -99,7 +120,7 @@ jobs:
exit ${CUCUMBER_EXIT} exit ${CUCUMBER_EXIT}
- name: Publish cucumber reports - name: Publish cucumber reports
if: always() if: env.TOOL_OK == 'true'
shell: bash shell: bash
run: | run: |
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/cucumber" bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/cucumber"
@@ -108,17 +129,20 @@ jobs:
if: always() if: always()
shell: bash shell: bash
run: | run: |
if [ "${CUCUMBER_EXIT}" = "0" ]; then if [ "${TOOL_OK}" != "true" ]; then
STATUS="failure"
DESC="Cucumber tool unavailable"
URL="https://gitea.app.keskikuja.site/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
elif [ "${CUCUMBER_EXIT}" = "0" ]; then
STATUS="success" STATUS="success"
DESC="Cucumber tests passed" DESC="Cucumber tests passed"
URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/cucumber/"
else else
STATUS="failure" STATUS="failure"
DESC="Cucumber tests FAILED" DESC="Cucumber tests FAILED"
URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/cucumber/"
fi fi
bash .ci/scripts/report-status.sh "$STATUS" \ bash .ci/scripts/report-status.sh "$STATUS" "$DESC" "$URL" ci-cucumber
"$DESC" \
"https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/cucumber/" \
ci-cucumber
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest