@@ -14,7 +14,6 @@ concurrency:
1414 cancel-in-progress : true
1515
1616permissions :
17- id-token : write
1817 contents : write
1918
2019jobs :
@@ -41,31 +40,91 @@ jobs:
4140 return all_file_count === docs_file_count;
4241 result-encoding : string
4342
44- rust :
43+ # Build guests once, upload as artifacts for other jobs to download
44+ build-guests :
45+ needs : docs-pr
46+ strategy :
47+ fail-fast : true
48+ matrix :
49+ config : [debug, release]
50+ uses : ./.github/workflows/dep_build_guests.yml
51+ secrets : inherit
52+ with :
53+ docs_only : ${{ needs.docs-pr.outputs.docs-only }}
54+ config : ${{ matrix.config }}
55+
56+ # Code checks (fmt, clippy, MSRV) - runs in parallel with build-guests
57+ code-checks :
58+ needs : docs-pr
59+ uses : ./.github/workflows/dep_code_checks.yml
60+ secrets : inherit
61+ with :
62+ docs_only : ${{ needs.docs-pr.outputs.docs-only }}
63+
64+ # Build and test - needs guest artifacts
65+ build-test :
4566 needs :
4667 - docs-pr
68+ - build-guests
4769 strategy :
4870 fail-fast : true
4971 matrix :
5072 hypervisor : [hyperv, 'hyperv-ws2025', mshv3, kvm]
5173 cpu : [amd, intel]
5274 config : [debug, release]
53- uses : ./.github/workflows/dep_rust .yml
75+ uses : ./.github/workflows/dep_build_test .yml
5476 secrets : inherit
5577 with :
56- docs_only : ${{needs.docs-pr.outputs.docs-only}}
78+ docs_only : ${{ needs.docs-pr.outputs.docs-only }}
5779 hypervisor : ${{ matrix.hypervisor }}
5880 cpu : ${{ matrix.cpu }}
5981 config : ${{ matrix.config }}
6082
83+ # Run examples - needs guest artifacts, runs in parallel with build-test
84+ run-examples :
85+ needs :
86+ - docs-pr
87+ - build-guests
88+ strategy :
89+ fail-fast : true
90+ matrix :
91+ hypervisor : [hyperv, 'hyperv-ws2025', mshv3, kvm]
92+ cpu : [amd, intel]
93+ config : [debug, release]
94+ uses : ./.github/workflows/dep_run_examples.yml
95+ secrets : inherit
96+ with :
97+ docs_only : ${{ needs.docs-pr.outputs.docs-only }}
98+ hypervisor : ${{ matrix.hypervisor }}
99+ cpu : ${{ matrix.cpu }}
100+ config : ${{ matrix.config }}
101+
102+ # Run benchmarks - release only, needs guest artifacts, runs in parallel with build-test
103+ benchmarks :
104+ needs :
105+ - docs-pr
106+ - build-guests
107+ strategy :
108+ fail-fast : true
109+ matrix :
110+ hypervisor : [hyperv, 'hyperv-ws2025', mshv3, kvm]
111+ cpu : [amd, intel]
112+ uses : ./.github/workflows/dep_benchmarks.yml
113+ secrets : inherit
114+ with :
115+ docs_only : ${{ needs.docs-pr.outputs.docs-only }}
116+ hypervisor : ${{ matrix.hypervisor }}
117+ cpu : ${{ matrix.cpu }}
118+
61119 fuzzing :
62120 needs :
63121 - docs-pr
122+ - build-guests
64123 uses : ./.github/workflows/dep_fuzzing.yml
65124 with :
66125 targets : ' ["fuzz_host_print", "fuzz_guest_call", "fuzz_host_call", "fuzz_guest_estimate_trace_event", "fuzz_guest_trace"]' # Pass as a JSON array
67126 max_total_time : 300 # 5 minutes in seconds
68- docs_only : ${{needs.docs-pr.outputs.docs-only}}
127+ docs_only : ${{ needs.docs-pr.outputs.docs-only }}
69128 secrets : inherit
70129
71130 spelling :
@@ -85,21 +144,20 @@ jobs:
85144 run : ./dev/check-license-headers.sh
86145
87146 # Gate PR merges on this specific "join-job" which requires all other
88- # jobs to run first. We need this job since we cannot gate on particular jobs
89- # in the workflow, since they can sometimes be skipped (e.g. if the PR only touches docs).
90- # This step fixes this issue by always running.
147+ # jobs to run first.
91148 report-ci-status :
92149 needs :
93150 - docs-pr
94- - rust
151+ - build-guests
152+ - code-checks
153+ - build-test
154+ - run-examples
155+ - benchmarks
95156 - fuzzing
96157 - spelling
97158 - license-headers
98159 if : always()
99160 runs-on : ubuntu-latest
100161 steps :
101- # Calculate the exit status of the whole CI workflow.
102- # If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
103- # If a some dependent job has failed, this exits with 1.
104162 - name : calculate the correct exit status
105163 run : jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
0 commit comments