From 0598ca55c38e75f789103cc3b981fd3909b5e84d Mon Sep 17 00:00:00 2001 From: Jamil Date: Tue, 20 Feb 2024 15:46:59 -0800 Subject: [PATCH] fix(ci): Fix result overwrite (#3700) Buttoning up fixes from #3695 --- .github/workflows/ci.yml | 3 +-- scripts/tests/perf/results.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab4e3c72f..e63b081cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -320,9 +320,8 @@ jobs: curl -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -L -o "${ARTIFACT_NAME}.zip" "$DOWNLOAD_URL" set -x - unzip "${ARTIFACT_NAME}.zip" + unzip "${ARTIFACT_NAME}.zip" -d "./main" rm "${ARTIFACT_NAME}.zip" - mv "${{ matrix.test_name }}.json" "${{ matrix.test_name }}-main.json" fi - name: Update PR with results uses: actions/github-script@v7 diff --git a/scripts/tests/perf/results.js b/scripts/tests/perf/results.js index 7fbe1389d..71eb86633 100644 --- a/scripts/tests/perf/results.js +++ b/scripts/tests/perf/results.js @@ -1,4 +1,5 @@ const fs = require("fs"); +const path = require("path"); function getDiffPercents(main, current) { let diff = -1 * (100 - current / (main / 100)); @@ -40,7 +41,7 @@ exports.script = async function (github, context, test_name) { // 2. Read the main results const results_main = JSON.parse( - fs.readFileSync(test_name + "-main.json") + fs.readFileSync(path.join("main", test_name + ".json")) ).end; let output = "";