Don't fail build jobs if report generation fails.

Fixes #24.
This commit is contained in:
Fabio Niephaus
2022-12-01 13:36:35 +01:00
parent a20b6434b3
commit 778af55c2a
4 changed files with 39 additions and 35 deletions

30
dist/main/index.js generated vendored
View File

@@ -74253,21 +74253,23 @@ function setUpNativeImageBuildReports(graalVMVersion) {
}
exports.setUpNativeImageBuildReports = setUpNativeImageBuildReports;
function generateReports() {
if (areJobReportsEnabled() || arePRReportsEnabled()) {
if (!fs.existsSync(BUILD_OUTPUT_JSON_PATH)) {
core.warning('Unable to find build output data to create a report. Are you sure this build job has used GraalVM Native Image?');
return;
return __awaiter(this, void 0, void 0, function* () {
if (areJobReportsEnabled() || arePRReportsEnabled()) {
if (!fs.existsSync(BUILD_OUTPUT_JSON_PATH)) {
core.warning('Unable to find build output data to create a report. Are you sure this build job has used GraalVM Native Image?');
return;
}
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
const report = createReport(buildOutput);
if (areJobReportsEnabled()) {
core.summary.addRaw(report);
core.summary.write();
}
if (arePRReportsEnabled()) {
utils_1.createPRComment(report);
}
}
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
const report = createReport(buildOutput);
if (areJobReportsEnabled()) {
core.summary.addRaw(report);
core.summary.write();
}
if (arePRReportsEnabled()) {
utils_1.createPRComment(report);
}
}
});
}
exports.generateReports = generateReports;
function areJobReportsEnabled() {