@@ -53,14 +53,48 @@ async function validate(args: string[]) {
53
53
const runCommands = createCommandRunner ( tmpDir ) ;
54
54
55
55
// VALIDATE TUTORIAL TESTS
56
+
57
+ // setup
56
58
if ( commits . INIT ) {
57
59
// load commits
58
60
console . info ( "Loading setup commits..." ) ;
59
- cherryPick ( commits . INIT ) ;
61
+ await cherryPick ( commits . INIT ) ;
60
62
61
63
// run commands
62
64
if ( skeleton . config ?. testRunner ?. setup ?. commands ) {
63
- runCommands ( skeleton . config ?. testRunner ?. setup ?. commands ) ;
65
+ console . info ( "Running setup commands..." ) ;
66
+ await runCommands ( skeleton . config ?. testRunner ?. setup ?. commands ) ;
67
+ }
68
+ }
69
+
70
+ console . log ( skeleton . levels ) ;
71
+ for ( const level of skeleton . levels ) {
72
+ if ( level . setup ) {
73
+ // load commits
74
+ if ( level . setup . commits ) {
75
+ console . log ( `Loading ${ level . id } commits...` ) ;
76
+ await cherryPick ( commits [ level . id ] ) ;
77
+ }
78
+ // run commands
79
+ if ( level . setup . commands ) {
80
+ console . log ( `Running ${ level . id } commands...` ) ;
81
+ await runCommands ( level . setup . commands ) ;
82
+ }
83
+ }
84
+ // steps
85
+ if ( level . steps ) {
86
+ for ( const step of level . steps ) {
87
+ // load commits
88
+ if ( step . setup . commits ) {
89
+ console . log ( `Loading ${ step . id } commits...` ) ;
90
+ await cherryPick ( commits [ step . id ] ) ;
91
+ }
92
+ // run commands
93
+ if ( step . setup . commands ) {
94
+ console . log ( `Running ${ step . id } commands...` ) ;
95
+ await runCommands ( step . setup . commands ) ;
96
+ }
97
+ }
64
98
}
65
99
}
66
100
0 commit comments