ci: fix visual-regression report comments (#46366)

This commit is contained in:
vagusX 2023-12-10 15:23:58 +08:00 committed by GitHub
parent 7937302012
commit eb166f7902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -90,7 +90,8 @@ jobs:
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
run: |
tar -xzvf visualRegressionReport.tar.gz
mkdir ./visualRegressionReport
tar -xzvf visualRegressionReport.tar.gz -C ./visualRegressionReport
echo "✅ Uncompress Finished"
rm package.json
@ -114,7 +115,7 @@ jobs:
${{ steps.report.outputs.content }}
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
body-include: '<!-- VISUAL_DIFF_REGRESSION_HOOK -->'
number: ${{ steps.pr.outputs.id }}
number: ${{ steps.report.outputs.id }}
- name: failed comment
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-failure) || steps.report.outcome == 'failure' || failure() }}
@ -126,4 +127,4 @@ jobs:
😔 📉 📊 ❌ 🚫
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
body-include: '<!-- VISUAL_DIFF_REGRESSION_HOOK -->'
number: ${{ steps.pr.outputs.id }}
number: ${{ steps.report.outputs.id }}

View File

@ -91,6 +91,7 @@ async function downloadBaseSnapshots(ref: string, targetDir: string) {
await downloadFile(imageSnapshotsUrl, targzPath);
// untar
return tar.x({
// remove top-level dir
strip: 1,
C: targetDir,
file: targzPath,
@ -167,7 +168,7 @@ async function boot() {
await fse.ensureDir(baseImgReportDir);
await fse.ensureDir(currentImgReportDir);
console.log(chalk.blue('⛳ Checking image snapshots with branch `master`'));
console.log(chalk.blue('⛳ Checking image snapshots with branch %s'), targetBranch);
console.log('\n');
const baseImgFileList = readPngs(baseImgSourceDir);
@ -238,6 +239,7 @@ async function boot() {
await tar.c(
{
gzip: true,
// ignore top-level dir(e.g. visualRegressionReport) and zip all files in it
cwd: reportDir,
file: `${path.basename(reportDir)}.tar.gz`,
},