1717 build :
1818 uses : ./.github/workflows/build.yml
1919
20+ # Check CI status in parallel with builds (for faster feedback)
21+ check-ci :
22+ name : Check FC repo CI status
23+ runs-on : ubuntu-latest
24+ outputs :
25+ ci_passed : ${{ steps.ci-check.outputs.ci_passed }}
26+ steps :
27+ - uses : actions/checkout@v4
28+
29+ - name : Check CI status for all versions
30+ id : ci-check
31+ env :
32+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33+ run : |
34+ output=$(./scripts/check-fc-ci.sh firecracker_versions.txt)
35+ echo "$output"
36+ # Extract ci_passed from last line
37+ ci_passed=$(echo "$output" | grep "^ci_passed=" | cut -d= -f2)
38+ echo "ci_passed=$ci_passed" >> $GITHUB_OUTPUT
39+
40+ # Collect artifacts and publish (waits for both build and CI check)
2041 publish :
2142 name : Collect and upload builds
22- needs : build
43+ needs : [ build, check-ci]
2344 runs-on : ubuntu-22.04
2445 steps :
2546 - name : Checkout repository
@@ -38,76 +59,22 @@ jobs:
3859 - name : List downloaded builds
3960 run : find builds -type f | head -20
4061
41- # Download version info to get commit hashes
42- - name : Download version info
43- uses : actions/download-artifact@v4
44- with :
45- path : version-info
46- pattern : version-info-*
47- merge-multiple : true
48-
49- # Check CI status for all commits (runs on all branches for visibility)
50- - name : Check CI status for all versions
51- id : ci-check
52- env :
53- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62+ - name : CI check result
5463 run : |
55- FIRECRACKER_REPO="e2b-dev/firecracker"
56- all_passed=true
57- failed_versions=""
58-
59- # Read all version:hash pairs
60- for line in $(cat version-info/built_versions.txt 2>/dev/null || echo ""); do
61- version_name=$(echo "$line" | cut -d: -f1)
62- commit_hash=$(echo "$line" | cut -d: -f2)
63-
64- echo "Checking CI for $version_name (commit: $commit_hash)..."
65-
66- # Check combined commit status
67- status=$(gh api "/repos/${FIRECRACKER_REPO}/commits/${commit_hash}/status" --jq '.state' 2>/dev/null || echo "unknown")
68-
69- # Check check-runs (GitHub Actions)
70- check_conclusion=$(gh api "/repos/${FIRECRACKER_REPO}/commits/${commit_hash}/check-runs" --jq '
71- if .total_count == 0 then "no_checks"
72- elif ([.check_runs[].conclusion] | all(. == "success" or . == "skipped" or . == null)) then "success"
73- elif ([.check_runs[].status] | any(. == "in_progress" or . == "queued")) then "pending"
74- else "failure"
75- end
76- ' 2>/dev/null || echo "unknown")
77-
78- echo " Status: $status, Check runs: $check_conclusion"
79-
80- if [[ "$status" == "failure" ]] || [[ "$check_conclusion" == "failure" ]]; then
81- echo " ❌ CI failed for $version_name"
82- all_passed=false
83- failed_versions="${failed_versions}${version_name} "
84- elif [[ "$status" == "pending" ]] || [[ "$check_conclusion" == "pending" ]]; then
85- echo " ⏳ CI still running for $version_name"
86- all_passed=false
87- failed_versions="${failed_versions}${version_name}(pending) "
88- else
89- echo " ✅ CI passed for $version_name"
90- fi
91- done
92-
93- if [[ "$all_passed" == "true" ]]; then
94- echo "All CI checks passed!"
95- echo "ci_passed=true" >> $GITHUB_OUTPUT
96- else
97- echo "CI checks failed or pending for: $failed_versions"
98- echo "ci_passed=false" >> $GITHUB_OUTPUT
99- echo "Skipping GCS upload and release creation."
64+ echo "CI check passed: ${{ needs.check-ci.outputs.ci_passed }}"
65+ if [[ "${{ needs.check-ci.outputs.ci_passed }}" != "true" ]]; then
66+ echo "⚠️ CI checks did not pass - skipping GCS upload and release"
10067 fi
10168
10269 - name : Setup Service Account
103- if : github.ref_name == 'main' && steps.ci- check.outputs.ci_passed == 'true'
70+ if : github.ref_name == 'main' && needs. check-ci .outputs.ci_passed == 'true'
10471 uses : google-github-actions/auth@v2
10572 with :
10673 project_id : ${{ secrets.GCP_PROJECT_ID }}
10774 workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
10875
10976 - name : Upload firecrackers to GCS
110- if : github.ref_name == 'main' && steps.ci- check.outputs.ci_passed == 'true'
77+ if : github.ref_name == 'main' && needs. check-ci .outputs.ci_passed == 'true'
11178 uses : " google-github-actions/upload-cloud-storage@v1"
11279 with :
11380 path : " ./builds"
11683 parent : false
11784
11885 - name : Create releases for each Firecracker version
119- if : github.ref_name == 'main' && steps.ci- check.outputs.ci_passed == 'true'
86+ if : github.ref_name == 'main' && needs. check-ci .outputs.ci_passed == 'true'
12087 env :
12188 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
12289 run : |
0 commit comments