srghaer
CI / Load gitea-env.conf to pipeline env (push) Successful in 12s
ci-check-running Checking version...
ci-check Build version 0.1.0 required
ci-cucumber Cucumber tests
ci-bats Bats tests
ci-build Build complete
CI / Build & Push Artifact (push) Successful in 2m29s
CI / Load gitea-env.conf to pipeline env (push) Successful in 12s
ci-check-running Checking version...
ci-check Build version 0.1.0 required
ci-cucumber Cucumber tests
ci-bats Bats tests
ci-build Build complete
CI / Build & Push Artifact (push) Successful in 2m29s
This commit is contained in:
@@ -35,6 +35,7 @@ jobs:
|
|||||||
- name: Check existing artifact
|
- name: Check existing artifact
|
||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
|
bash scripts/report-status.sh pending "Checking version..." ci-check-running
|
||||||
VERSION=$(jq -r '.version' package.json)
|
VERSION=$(jq -r '.version' package.json)
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
|
bash scripts/report-status.sh pending "Building Docker image..." ci-docker-build-running
|
||||||
VERSION="${{ needs.check.outputs.version }}"
|
VERSION="${{ needs.check.outputs.version }}"
|
||||||
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
docker build \
|
docker build \
|
||||||
@@ -163,6 +165,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
id: push
|
id: push
|
||||||
run: |
|
run: |
|
||||||
|
bash scripts/report-status.sh pending "Pushing to registry..." ci-docker-push-running
|
||||||
VERSION="${{ needs.check.outputs.version }}"
|
VERSION="${{ needs.check.outputs.version }}"
|
||||||
docker load -i /tmp/image/artifact.tar
|
docker load -i /tmp/image/artifact.tar
|
||||||
REGISTRY=$(echo "$GITEA_API_URL" | sed 's|https://||')
|
REGISTRY=$(echo "$GITEA_API_URL" | sed 's|https://||')
|
||||||
@@ -195,6 +198,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
|
bash scripts/report-status.sh pending "Creating tag..." ci-docker-tag-running
|
||||||
VERSION="${{ needs.check.outputs.version }}"
|
VERSION="${{ needs.check.outputs.version }}"
|
||||||
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
|
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
|
||||||
"$GITEA_API_URL/api/v1/repos/${{ github.repository }}/tags" \
|
"$GITEA_API_URL/api/v1/repos/${{ github.repository }}/tags" \
|
||||||
|
|||||||
@@ -34,7 +34,15 @@ jobs:
|
|||||||
path: .ci
|
path: .ci
|
||||||
|
|
||||||
- name: Validate CI config
|
- name: Validate CI config
|
||||||
run: bash .ci/scripts/ci-validate.sh
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh pending "Validating CI config..." ci-validate-running
|
||||||
|
bash .ci/scripts/ci-validate.sh
|
||||||
|
bash .ci/scripts/report-status.sh success "CI config valid" ci-validate
|
||||||
|
|
||||||
|
- name: Report validate running
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh pending "Validating CI config..." ci-validate-running
|
||||||
|
|
||||||
bats:
|
bats:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -65,6 +73,11 @@ jobs:
|
|||||||
echo "BATS_EXIT=${BATS_EXIT}" >> "${GITHUB_ENV}"
|
echo "BATS_EXIT=${BATS_EXIT}" >> "${GITHUB_ENV}"
|
||||||
exit ${BATS_EXIT}
|
exit ${BATS_EXIT}
|
||||||
|
|
||||||
|
- name: Report bats running
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh pending "Running Bats tests..." ci-bats-running
|
||||||
|
|
||||||
- name: Publish bats reports
|
- name: Publish bats reports
|
||||||
if: always()
|
if: always()
|
||||||
run: bash .ci/scripts/publish-git-pages.sh bats
|
run: bash .ci/scripts/publish-git-pages.sh bats
|
||||||
@@ -73,7 +86,7 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
if [ "${BATS_EXIT}" = "0" ]; then
|
if [ "${BATS_EXIT}" = "0" ]; then
|
||||||
bash .ci/scripts/report-status.sh success "Bats tests" ci-bats bats
|
bash .ci/scripts/report-status.sh success "Bats tests OK" ci-bats bats
|
||||||
else
|
else
|
||||||
bash .ci/scripts/report-status.sh failure "Bats tests FAILED" ci-bats bats
|
bash .ci/scripts/report-status.sh failure "Bats tests FAILED" ci-bats bats
|
||||||
fi
|
fi
|
||||||
@@ -105,13 +118,18 @@ jobs:
|
|||||||
STATE="success"
|
STATE="success"
|
||||||
[ "${CUCUMBER_EXIT}" != "0" ] && STATE="failure"
|
[ "${CUCUMBER_EXIT}" != "0" ] && STATE="failure"
|
||||||
if [ -f "reports/${GITHUB_SHA:0:8}/cucumber/index.html" ]; then
|
if [ -f "reports/${GITHUB_SHA:0:8}/cucumber/index.html" ]; then
|
||||||
bash .ci/scripts/report-status.sh "${STATE}" "Cucumber tests" ci-cucumber cucumber
|
bash .ci/scripts/report-status.sh "${STATE}" "Cucumber tests OK" ci-cucumber cucumber
|
||||||
else
|
else
|
||||||
bash .ci/scripts/report-status.sh "${STATE}" "Cucumber tests" ci-cucumber
|
bash .ci/scripts/report-status.sh "${STATE}" "Cucumber tests OK" ci-cucumber
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit ${CUCUMBER_EXIT}
|
exit ${CUCUMBER_EXIT}
|
||||||
|
|
||||||
|
- name: Report cucumber running
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh pending "Running Cucumber tests..." ci-cucumber-running
|
||||||
|
|
||||||
- name: Publish cucumber reports
|
- name: Publish cucumber reports
|
||||||
if: always()
|
if: always()
|
||||||
run: bash .ci/scripts/publish-git-pages.sh cucumber
|
run: bash .ci/scripts/publish-git-pages.sh cucumber
|
||||||
@@ -127,7 +145,9 @@ jobs:
|
|||||||
path: .ci
|
path: .ci
|
||||||
|
|
||||||
- name: Generate report index
|
- name: Generate report index
|
||||||
run: bash .ci/.gitea/scripts/generate-report-index.sh
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh pending "Generating report index..." ci-build-running
|
||||||
|
bash .ci/.gitea/scripts/generate-report-index.sh
|
||||||
|
|
||||||
- name: Set build commit status
|
- name: Set build commit status
|
||||||
run: bash .ci/scripts/report-status.sh success "Build complete" ci-build
|
run: bash .ci/scripts/report-status.sh success "Build complete" ci-build
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# https://docs.gitea.com/api/next/#tag/repository/operation/repoCreateStatus
|
||||||
|
|
||||||
STATE="${1:-}"
|
STATE="${1:-}"
|
||||||
DESCRIPTION="${2:-}"
|
DESCRIPTION="${2:-}"
|
||||||
KEY="${3:-commit-${GITHUB_SHA:0:8}}"
|
KEY="${3:-commit-${GITHUB_SHA:0:8}}"
|
||||||
|
|||||||
Reference in New Issue
Block a user