Skip to content

Commit 6f1c7ff

Browse files
committed
load solution commits
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent 9df45b1 commit 6f1c7ff

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

src/validate.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async function validate(args: string[]) {
8080
for (const level of skeleton.levels) {
8181
if (level.setup) {
8282
// load commits
83-
if (level.setup.commits) {
83+
if (commits[`${level.id}`]) {
8484
console.log(`Loading ${level.id} commits...`);
8585
await cherryPick(commits[level.id]);
8686
}
@@ -93,21 +93,36 @@ async function validate(args: string[]) {
9393
// steps
9494
if (level.steps) {
9595
for (const step of level.steps) {
96-
console.log(step);
9796
// load commits
98-
if (step.setup.commits) {
99-
console.log(`Loading ${step.id} commits...`);
100-
await cherryPick(commits[step.id]);
97+
const stepSetupCommits = commits[`${step.id}Q`];
98+
if (stepSetupCommits) {
99+
console.info(`Loading ${step.id} setup commits...`);
100+
await cherryPick(stepSetupCommits);
101101
}
102102
// run commands
103103
if (step.setup.commands) {
104-
console.log(`Running ${step.id} commands...`);
104+
console.info(`Running ${step.id} setup commands...`);
105105
await runCommands(step.setup.commands);
106106
}
107107

108-
// run test
109-
console.info("Running test");
110-
await runTest();
108+
// ignore runnning tests on steps with no solution
109+
if (step.solution) {
110+
// run test
111+
console.info("Running test");
112+
// await runTest();
113+
}
114+
115+
const stepSolutionCommits = commits[`${step.id}A`];
116+
if (stepSolutionCommits) {
117+
console.info(`Loading ${step.id} solution commits...`);
118+
await cherryPick(stepSolutionCommits);
119+
}
120+
121+
// run commands
122+
if (step?.solution?.commands) {
123+
console.info(`Running ${step.id} solution commands...`);
124+
await runCommands(step.solution.commands);
125+
}
111126
}
112127
}
113128
}

0 commit comments

Comments
 (0)