@@ -122,7 +122,7 @@ Map<String, String> generateGitHubYml(RootConfig rootConfig) {
122122 Map .fromEntries (allJobs.map ((e) => MapEntry (e.id, e.value)));
123123
124124 for (var completion in completionMap.entries) {
125- final job = completion.key.completionJobFactory !()
125+ final job = completion.key.completionJobFactory !(rootConfig )
126126 ..needs = completion.value.toList ();
127127
128128 jobList['job_${jobList .length + 1 }' ] = job;
@@ -204,7 +204,10 @@ Iterable<_MapEntryWithStage> _listJobs(
204204
205205 for (var job in jobs) {
206206 if (job is _SelfValidateJob ) {
207- yield jobEntry (_selfValidateJob (rootConfig.monoConfig), job.stageName);
207+ yield jobEntry (
208+ _selfValidateJob (rootConfig.monoConfig, rootConfig),
209+ job.stageName,
210+ );
208211 continue ;
209212 }
210213
@@ -340,6 +343,7 @@ extension on CIJobEntry {
340343 job.flavor,
341344 job.sdk,
342345 commandEntries,
346+ rootConfig,
343347 config: rootConfig.monoConfig,
344348 additionalCacheKeys: {
345349 'packages' : packages.join ('-' ),
@@ -382,7 +386,8 @@ Job _githubJob(
382386 String runsOn,
383387 PackageFlavor packageFlavor,
384388 String sdkVersion,
385- List <_CommandEntryBase > runCommands, {
389+ List <_CommandEntryBase > runCommands,
390+ RootConfig rootConfig, {
386391 required BasicConfiguration config,
387392 Map <String , String >? additionalCacheKeys,
388393}) =>
@@ -393,17 +398,20 @@ Job _githubJob(
393398 if (! runsOn.startsWith ('windows' ))
394399 _cacheEntries (
395400 runsOn,
401+ rootConfig: rootConfig,
396402 additionalCacheKeys: {
397403 'sdk' : sdkVersion,
398404 if (additionalCacheKeys != null ) ...additionalCacheKeys,
399405 },
400406 ),
401- packageFlavor.setupStep (sdkVersion),
407+ packageFlavor.setupStep (sdkVersion, rootConfig ),
402408 ..._beforeSteps (runCommands.whereType <_CommandEntry >()),
403409 ActionInfo .checkout.usage (
404410 id: 'checkout' ,
411+ versionOverrides: rootConfig.existingActionVersions,
405412 ),
406- for (var command in runCommands) ...command.runContent (config),
413+ for (var command in runCommands)
414+ ...command.runContent (config, rootConfig),
407415 ],
408416 );
409417
@@ -424,7 +432,7 @@ class _CommandEntryBase {
424432
425433 _CommandEntryBase (this .name, this .run);
426434
427- Iterable <Step > runContent (BasicConfiguration config) =>
435+ Iterable <Step > runContent (BasicConfiguration config, RootConfig rootConfig ) =>
428436 [Step .run (name: name, run: run)];
429437}
430438
@@ -444,15 +452,16 @@ class _CommandEntry extends _CommandEntryBase {
444452 });
445453
446454 @override
447- Iterable <Step > runContent (BasicConfiguration config) => [
455+ Iterable <Step > runContent (BasicConfiguration config, RootConfig rootConfig) =>
456+ [
448457 Step .run (
449458 id: id,
450459 name: name,
451460 ifContent: ifCondition,
452461 workingDirectory: workingDirectory,
453462 run: run,
454463 ),
455- ...? type? .afterEachSteps (workingDirectory, config),
464+ ...? type? .afterEachSteps (workingDirectory, config, rootConfig ),
456465 ];
457466}
458467
@@ -464,6 +473,7 @@ class _CommandEntry extends _CommandEntryBase {
464473/// store and retrieve the cache.
465474Step _cacheEntries (
466475 String runsOn, {
476+ required RootConfig rootConfig,
467477 Map <String , String >? additionalCacheKeys,
468478}) {
469479 final cacheKeyParts = [
@@ -490,6 +500,7 @@ Step _cacheEntries(
490500 'key' : restoreKeys.first,
491501 'restore-keys' : restoreKeys.skip (1 ).join ('\n ' ),
492502 },
503+ versionOverrides: rootConfig.existingActionVersions,
493504 );
494505}
495506
@@ -500,7 +511,8 @@ String _maxLength(String input) {
500511 return input.substring (0 , 512 - hash.length) + hash;
501512}
502513
503- Job _selfValidateJob (BasicConfiguration config) => _githubJob (
514+ Job _selfValidateJob (BasicConfiguration config, RootConfig rootConfig) =>
515+ _githubJob (
504516 selfValidateJobName,
505517 _ubuntuLatest,
506518 PackageFlavor .dart,
@@ -509,6 +521,7 @@ Job _selfValidateJob(BasicConfiguration config) => _githubJob(
509521 for (var command in selfValidateCommands)
510522 _CommandEntryBase (selfValidateJobName, command),
511523 ],
524+ rootConfig,
512525 config: config,
513526 );
514527
@@ -537,16 +550,18 @@ class _MapEntryWithStage {
537550}
538551
539552extension on PackageFlavor {
540- Step setupStep (String sdkVersion) {
553+ Step setupStep (String sdkVersion, RootConfig rootConfig ) {
541554 switch (this ) {
542555 case PackageFlavor .dart:
543556 return ActionInfo .setupDart.usage (
544557 withContent: {'sdk' : sdkVersion},
558+ versionOverrides: rootConfig.existingActionVersions,
545559 );
546560
547561 case PackageFlavor .flutter:
548562 return ActionInfo .setupFlutter.usage (
549563 withContent: {'channel' : sdkVersion},
564+ versionOverrides: rootConfig.existingActionVersions,
550565 );
551566 }
552567 }
0 commit comments