Skip to content

Commit

Permalink
fix: metric recover (#3388)
Browse files Browse the repository at this point in the history
* chore: πŸ€– init

* chore: πŸ€– print log

* chore: πŸ€– remove out.md when no diff

* chore: πŸ€– test diff

* chore: πŸ€– recover
  • Loading branch information
IWANABETHATGUY authored Jun 1, 2023
1 parent d6bebb4 commit 2ebf8f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ jobs:
run: node ./webpack-test/scripts/generate.js ${{ secrets.GITHUB_TOKEN }} ${{ github.sha }}

# ### update metric diff against main branch when pull request change
# - name: Update
# if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' && github.event_name == 'pull_request' && matrix.node == '18' }}
# uses: ./.github/actions/webpack-test-metric-diff
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# sha: ${{ github.sha }}
- name: Update
if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' && github.event_name == 'pull_request' && matrix.node == '18' }}
uses: ./.github/actions/webpack-test-metric-diff
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.sha }}
3 changes: 3 additions & 0 deletions webpack-test/scripts/pr-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const [, , token, commit_sha] = process.argv;
let lastestMainCommit = indexList[indexList.length - 1];

let latestMainCommitData = historyData[lastestMainCommit];
console.log(latestMainCommitData);

let currentCompatibility = currentData["Tests Compatibility"];
let lastestMainCommitCompatibility =
Expand All @@ -70,6 +71,8 @@ ${lastestMainCommitCompatibility},${currentCompatibility},${`${icon} ${diff.toFi
true,
);
fs.appendFileSync(path.resolve(rootDir, "output.md"), markdown);
} else {
fs.rmSync(path.resolve(rootDir, "output.md"));
}

break;
Expand Down

0 comments on commit 2ebf8f1

Please sign in to comment.