@@ -161,6 +161,8 @@ pub enum RunType {
161161 TryJob { job_patterns : Option < Vec < String > > } ,
162162 /// Merge attempt workflow
163163 AutoJob ,
164+ /// Fake job only used for sharing Github Actions cache.
165+ MasterJob ,
164166}
165167
166168/// Maximum number of custom try jobs that can be requested in a single
@@ -210,6 +212,7 @@ fn calculate_jobs(
210212 ( jobs, "try" , & db. envs . try_env )
211213 }
212214 RunType :: AutoJob => ( db. auto_jobs . clone ( ) , "auto" , & db. envs . auto_env ) ,
215+ RunType :: MasterJob => return Ok ( vec ! [ ] ) ,
213216 } ;
214217 let jobs = substitute_github_vars ( jobs. clone ( ) )
215218 . context ( "Failed to substitute GitHub context variables in jobs" ) ?;
@@ -262,14 +265,15 @@ pub fn calculate_job_matrix(
262265 eprintln ! ( "Run type: {run_type:?}" ) ;
263266
264267 let jobs = calculate_jobs ( & run_type, & db, channel) ?;
265- if jobs. is_empty ( ) {
268+ if jobs. is_empty ( ) && ! matches ! ( run_type , RunType :: MasterJob ) {
266269 return Err ( anyhow:: anyhow!( "Computed job list is empty" ) ) ;
267270 }
268271
269272 let run_type = match run_type {
270273 RunType :: PullRequest => "pr" ,
271274 RunType :: TryJob { .. } => "try" ,
272275 RunType :: AutoJob => "auto" ,
276+ RunType :: MasterJob => "master" ,
273277 } ;
274278
275279 eprintln ! ( "Output" ) ;
0 commit comments