uusi report logiikka
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 24s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m37s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 1m8s
CI Feature / Report Summary (push) Successful in 5s

This commit is contained in:
moilanik
2026-06-18 06:19:58 +03:00
parent 65d385f9b9
commit 31748e98cc
5 changed files with 167 additions and 167 deletions
+11 -27
View File
@@ -23,6 +23,8 @@ env:
jobs:
bats:
runs-on: ubuntu-latest
container:
image: ${{ inputs.bats-image }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
@@ -31,34 +33,16 @@ jobs:
path: .ci
- name: Run bats tests
id: bats-tests
shell: bash
run: |
docker volume create bats-workspace
tar c . | docker run --rm -i -v bats-workspace:/data alpine tar x -C /data
mkdir -p "reports/${GITHUB_SHA:0:8}/bats"
set +e
docker run --rm \
-v bats-workspace:/data \
--entrypoint bash ${{ inputs.bats-image }} \
-c 'cd /data && bashcov -- bats tests/' \
> "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1
BATS_EXIT=$?
bash .ci/.gitea/scripts/bats-coverage.sh bats-workspace "reports/${GITHUB_SHA:0:8}/bats"
docker volume rm bats-workspace > /dev/null 2>&1
bash .ci/.gitea/scripts/bats-report.sh "reports/${GITHUB_SHA:0:8}/bats"
echo "BATS_EXIT=${BATS_EXIT}" >> "${GITHUB_ENV}"
exit ${BATS_EXIT}
mkdir -p reports/bats
bashcov -- bats tests/ > reports/bats/results.txt 2>&1
- name: Publish bats reports
if: always()
run: bash .ci/scripts/publish-git-pages.sh bats
- name: Report status
- name: Post-process reports
if: always()
run: |
if [ "${BATS_EXIT}" = "0" ]; then
bash .ci/scripts/report-status.sh success "Link to Bats reports" unit-tests bats
else
bash .ci/scripts/report-status.sh failure "Link to Bats reports" unit-tests bats
fi
bash .ci/.gitea/scripts/bats-coverage.sh reports/bats
bash .ci/.gitea/scripts/bats-report.sh reports/bats
- name: Report
if: always()
run: bash .ci/scripts/ci-report.sh "Bats test report" unit-tests bats
+5 -27
View File
@@ -33,36 +33,14 @@ jobs:
path: .ci
- name: Run cucumber tests
id: cucumber-tests
shell: bash
run: |
mkdir -p "reports/${GITHUB_SHA:0:8}/cucumber"
set +e
mkdir -p reports/cucumber
npx cucumber-js \
--format json:"reports/${GITHUB_SHA:0:8}/cucumber/report.json" \
--format html:"reports/${GITHUB_SHA:0:8}/cucumber/index.html" 2>&1
CUCUMBER_EXIT=$?
echo "CUCUMBER_EXIT=${CUCUMBER_EXIT}" >> "${GITHUB_ENV}"
exit ${CUCUMBER_EXIT}
--format json:reports/cucumber/report.json \
--format html:reports/cucumber/report.html 2>&1
- name: Publish cucumber reports
if: always()
run: bash .ci/scripts/publish-git-pages.sh cucumber
- name: Report status
- name: Report
if: always()
shell: bash
run: |
if [ "${CUCUMBER_EXIT}" = "0" ]; then
if [ -f "reports/${GITHUB_SHA:0:8}/cucumber/index.html" ]; then
bash .ci/scripts/report-status.sh success "Link to Cucumber reports" acc-tests cucumber
else
bash .ci/scripts/report-status.sh success "Link to Cucumber reports" acc-tests
fi
else
if [ -f "reports/${GITHUB_SHA:0:8}/cucumber/index.html" ]; then
bash .ci/scripts/report-status.sh failure "Link to Cucumber reports" acc-tests cucumber
else
bash .ci/scripts/report-status.sh failure "Link to Cucumber reports" acc-tests
fi
fi
run: bash .ci/scripts/ci-report.sh "Cucumber test report" acc-tests cucumber