feat: implement quality-gate and publish-artifact pipelines
CI / load-config (push) Successful in 13s
CI / main (push) Has been skipped
ci-bats Bats tests
ci-cucumber Cucumber tests passed
ci-build Build complete
CI / feature (push) Successful in 2m6s

- Rename build-feature.yml → quality-gate.yml (merge-portti)
- Create build_publish-artifact.yml: check → qg → build → push → tag
- Add minimal Dockerfile for dogfood container build
- Simplify quality-gate.yml cucumber job (remove prepare step, TOOL_OK)
- Standardize test scripts in package.json for Docker-based local + CI runs
- Update ci.yml: main branch uses build_publish-artifact.yml
- Update docs/workflows.md: feature section rewritten with provider model
- Add .gitignore entries for coverage/ and reports/
This commit is contained in:
moilanik
2026-06-14 05:43:15 +03:00
parent 1128545d6b
commit 23874f59b6
7 changed files with 389 additions and 141 deletions
+14 -32
View File
@@ -49,20 +49,22 @@ jobs:
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"
docker volume create bats-cov
set +e
docker run --rm \
-v bats-workspace:/data \
-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 && cd /data && \
-c 'apk add -q lsof python3 jq curl ruby && \
gem install bashcov -v 3.3.0 2>&1 | tail -1 && \
bashcov -- bats tests/' \
> "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1
bashcov -- bats tests/ | tee /reports/results.txt'
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-coverage.sh bats-cov "reports/${GITHUB_SHA:0:8}/bats"
docker volume rm bats-cov > /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}
@@ -91,27 +93,12 @@ jobs:
repository: niko/gitea-ci-library
path: .ci
- name: Prepare cucumber
id: prepare-cucumber
shell: bash
run: |
apt-get update -qq && apt-get install -y -qq --no-install-recommends lsof jq
if npm install @cucumber/cucumber > /dev/null 2>&1 && \
npx --package @cucumber/cucumber cucumber-js --dry-run tests/features/ > /dev/null 2>&1; then
echo "TOOL_OK=true" >> "${GITHUB_ENV}"
else
echo "TOOL_OK=false" >> "${GITHUB_ENV}"
fi
- name: Run cucumber tests
if: always()
id: cucumber-tests
shell: bash
run: |
if [ "${TOOL_OK}" != "true" ]; then
echo "CUCUMBER_EXIT=1" >> "${GITHUB_ENV}"
exit 0
fi
apt-get update -qq && apt-get install -y -qq --no-install-recommends lsof jq
npm install @cucumber/cucumber > /dev/null 2>&1
mkdir -p "reports/${GITHUB_SHA:0:8}/cucumber"
set +e
npx cucumber-js \
@@ -123,17 +110,12 @@ jobs:
- name: Publish cucumber reports
if: always()
run: |
if [ "${TOOL_OK}" = "true" ]; then
bash .ci/scripts/publish-git-pages.sh cucumber
fi
run: bash .ci/scripts/publish-git-pages.sh cucumber
- name: Set cucumber commit status
if: always()
run: |
if [ "${TOOL_OK}" != "true" ]; then
bash .ci/scripts/report-status.sh failure "Cucumber tool unavailable" ci-cucumber
elif [ "${CUCUMBER_EXIT}" = "0" ]; then
if [ "${CUCUMBER_EXIT}" = "0" ]; then
bash .ci/scripts/report-status.sh success "Cucumber tests passed" ci-cucumber cucumber
else
bash .ci/scripts/report-status.sh failure "Cucumber tests FAILED" ci-cucumber cucumber