From 4869e49d3147657b6793498574c091c5611485dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Jul 2026 05:52:24 +0000 Subject: [PATCH] chore: move Verify integration build to own parallel job in cgo.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/cgo.yml | 86 +++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cgo.yml b/.github/workflows/cgo.yml index 971ecd6c51d..ac80c6309cc 100644 --- a/.github/workflows/cgo.yml +++ b/.github/workflows/cgo.yml @@ -39,10 +39,86 @@ on: - 'install-gh-aw.sh' workflow_dispatch: jobs: + verify-integration-build: + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + concurrency: + group: ci-${{ github.ref }}-verify-integration-build + cancel-in-progress: true + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Go + id: setup-go + uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6 + with: + go-version-file: go.mod + cache: true + + - name: Report Go cache status + run: | + if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then + echo "✅ Go cache hit" >> $GITHUB_STEP_SUMMARY + else + echo "⚠️ Go cache miss" >> $GITHUB_STEP_SUMMARY + fi + + - name: Download dependencies with retry + if: steps.setup-go.outputs.cache-hit != 'true' + run: | + set -e + MAX_RETRIES=3 + RETRY_DELAY=5 + + for i in $(seq 1 $MAX_RETRIES); do + echo "Attempt $i of $MAX_RETRIES: Downloading Go modules..." + # Use -x for verbose output to see what's being downloaded + if go mod download -x; then + echo "✅ Successfully downloaded Go modules" + break + else + EXIT_CODE=$? + if [ $i -eq $MAX_RETRIES ]; then + echo "❌ Failed to download Go modules after $MAX_RETRIES attempts (exit code: $EXIT_CODE)" + echo "This indicates that proxy.golang.org is unreachable or returning errors" + echo "" + echo "Diagnostic information:" + echo "- GOPROXY: $(go env GOPROXY)" + echo "- GOSUMDB: $(go env GOSUMDB)" + echo "- Network connectivity: checking proxy.golang.org..." + if curl -s -I --connect-timeout 5 https://proxy.golang.org/golang.org/@v/list >/dev/null 2>&1; then + echo " ✓ proxy.golang.org is reachable" + else + echo " ✗ proxy.golang.org is NOT reachable" + fi + exit 1 + fi + echo "⚠️ Download failed, retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + fi + done + + - name: Verify dependencies + run: go mod verify + + - name: Verify integration build + run: | + # Compile and link all integration-tagged test binaries without + # executing package test binaries or TestMain side effects. + # Regular unit tests use -tags '!integration', so build errors in + # integration-tagged files (e.g. unused imports) would otherwise + # go undetected until the fuzz job runs on main. + go test -run='^$' -exec=true -tags=integration ./... + test: name: Unit tests (${{ matrix.name }}) runs-on: ubuntu-latest timeout-minutes: 15 + needs: + - verify-integration-build permissions: contents: read strategy: @@ -128,15 +204,6 @@ jobs: - name: Verify dependencies run: go mod verify - - name: Verify integration build - run: | - # Compile and link all integration-tagged test binaries without - # executing package test binaries or TestMain side effects. - # Regular unit tests use -tags '!integration', so build errors in - # integration-tagged files (e.g. unused imports) would otherwise - # go undetected until the fuzz job runs on main. - go test -run='^$' -exec=true -tags=integration ./... - - name: Pre-flight check - Validate test dependencies run: | echo "Validating that test dependencies are available..." @@ -2358,6 +2425,7 @@ jobs: timeout-minutes: 5 if: always() && github.ref == 'refs/heads/main' needs: + - verify-integration-build - test - canary-go - build