github: write build summary

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2024-05-13 16:51:00 +02:00
parent 624e16fb7c
commit 1e903f84b6
8 changed files with 289 additions and 3 deletions

View File

@@ -17,6 +17,9 @@
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
import {JwtPayload} from 'jwt-decode';
import {BakeDefinition} from './bake';
import {ExportRecordResponse} from './history';
export interface GitHubRelease {
id: number;
tag_name: string;
@@ -47,3 +50,11 @@ export interface UploadArtifactResponse {
size: number;
url: string;
}
export interface BuildSummaryOpts {
exportRes: ExportRecordResponse;
uploadRes: UploadArtifactResponse;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
inputs?: any;
bakeDefinition?: BakeDefinition;
}

View File

@@ -22,7 +22,23 @@ export interface ExportRecordOpts {
export interface ExportRecordResponse {
dockerbuildFilename: string;
dockerbuildSize: number;
summaries: Summaries;
builderName: string;
nodeName: string;
refs: Array<string>;
}
export interface Summaries {
[ref: string]: RecordSummary;
}
export interface RecordSummary {
name: string;
status: string;
duration: string;
numCachedSteps: number;
numTotalSteps: number;
numCompletedSteps: number;
frontendAttrs: Record<string, string>;
error?: string;
}