Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"zod-urlsearchparams": "0.0.16"
},
"devDependencies": {
"@actions/core": "3.0.1",
"@eslint/json": "1.2.0",
"@fortawesome/fontawesome-free": "5.15.4",
"@monkeytype/oxlint-config": "workspace:*",
Expand Down
25 changes: 23 additions & 2 deletions frontend/scripts/check-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import { ChallengeSchema, Challenge } from "@monkeytype/schemas/challenges";
import { LayoutObject, LayoutObjectSchema } from "@monkeytype/schemas/layouts";
import { QuoteDataSchema, QuoteData } from "@monkeytype/schemas/quotes";
import { clickSoundConfig } from "../src/ts/constants/sounds";
import * as ghCore from "@actions/core";

const stepSummary = ghCore.summary;

class Problems<K extends string, T extends string> {
private type: string;
Expand Down Expand Up @@ -51,10 +54,21 @@ class Problems<K extends string, T extends string> {
return Object.keys(this.problems).length !== 0;
}
public toString(): string {
stepSummary.addHeading(`${this.type} Checks`, 2);
if (!this.hasError()) {
stepSummary.addRaw("✅ all checks passed").addEOL();
return `${this.type} are all \u001b[32mvalid\u001b[0m`;
}

Object.entries(this.problems).forEach(([key, problems]) => {
let label: string = this.labels[key as T] ?? `${key}`;
stepSummary
.addRaw(`❌ ${label}`)
.addEOL()
.addList(problems as string[])
.addEOL();
});

return (
`${this.type} are \u001b[31minvalid\u001b[0m\n` +
Object.entries(this.problems)
Expand Down Expand Up @@ -513,8 +527,15 @@ async function main(): Promise<void> {
}

if (tasks.size > 0) {
await Promise.all([...tasks].map(async (validator) => validator()));
return;
const results = await Promise.allSettled(
[...tasks].map(async (validator) => validator()),
);

await stepSummary.write();

if (results.find((it) => it.status === "rejected") !== undefined) {
throw new Error("One or more checks failed.");
}
}
}
void main();
96 changes: 38 additions & 58 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading