From 72ed47299d30cdb6d863368c5c7aa7211bdcb036 Mon Sep 17 00:00:00 2001 From: PeriodicallyZoneOut Date: Thu, 30 Apr 2026 09:59:13 +0700 Subject: [PATCH 1/2] pipeline-status-check-update --- .github/workflows/ci-pipeline.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 931b6eedbc..e559e3aca7 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -12,6 +12,7 @@ on: permissions: contents: read actions: write + statuses: write jobs: @@ -183,12 +184,14 @@ jobs: if: always() steps: - name: Evaluate results + id: gate shell: bash run: | set -euo pipefail if [[ "${{ needs.detect-changes.outputs.has_services }}" != "true" ]]; then echo "No Maven module changes detected; passing." + echo "state=success" >> "$GITHUB_OUTPUT" exit 0 fi @@ -196,8 +199,27 @@ jobs: echo "build result: ${{ needs.build.result }}" if [[ "${{ needs.test.result }}" != "success" || "${{ needs.build.result }}" != "success" ]]; then - echo "CI failed." - exit 1 + echo "state=failure" >> "$GITHUB_OUTPUT" + exit 0 fi - echo "CI passed." \ No newline at end of file + echo "state=success" >> "$GITHUB_OUTPUT" + + - name: Publish CI Gate status + uses: actions/github-script@v7 + with: + script: | + const state = '${{ steps.gate.outputs.state }}' || 'failure'; + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.sha, + state, + context: 'CI Gate', + description: state === 'success' ? 'CI Gate passed' : 'CI Gate failed', + target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` + }); + + - name: Fail if gate failed + if: steps.gate.outputs.state != 'success' + run: exit 1 \ No newline at end of file From 83253ad7c72ff69e946e52765452ba7d592e67a6 Mon Sep 17 00:00:00 2001 From: PeriodicallyZoneOut Date: Thu, 30 Apr 2026 10:11:39 +0700 Subject: [PATCH 2/2] fix-pipeline-status-check-update: retries for mvn test and package --- .github/workflows/ci-pipeline.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index e559e3aca7..0a16b90a78 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -144,7 +144,18 @@ jobs: cache: maven - name: Run tests for ${{ matrix.service }} - run: mvn -B -pl ${{ matrix.service }} -am test + shell: bash + run: | + set -euo pipefail + for attempt in 1 2 3; do + echo "Attempt $attempt: mvn test (${{ matrix.service }})" + if mvn -B -ntp -pl ${{ matrix.service }} -am test; then + exit 0 + fi + sleep $((attempt * 10)) + done + echo "Maven test failed after retries." + exit 1 - name: Upload test results for ${{ matrix.service }} if: always() @@ -175,7 +186,18 @@ jobs: cache: maven - name: Build ${{ matrix.service }} - run: mvn -B -pl ${{ matrix.service }} -am -DskipTests package + shell: bash + run: | + set -euo pipefail + for attempt in 1 2 3; do + echo "Attempt $attempt: mvn package (${{ matrix.service }})" + if mvn -B -ntp -pl ${{ matrix.service }} -am -DskipTests package; then + exit 0 + fi + sleep $((attempt * 10)) + done + echo "Maven build failed after retries." + exit 1 ci-gate: name: CI Gate