File tree Expand file tree Collapse file tree 1 file changed +40
-2
lines changed Expand file tree Collapse file tree 1 file changed +40
-2
lines changed Original file line number Diff line number Diff line change 1
1
name : Monitor Metrics
2
2
3
3
on :
4
- # schedule:
5
- # - cron: '0 21 * * *'
4
+ schedule :
5
+ - cron : ' 0 21 * * *'
6
6
workflow_dispatch :
7
7
8
8
jobs :
9
9
monitor :
10
+ continue-on-error : true
10
11
strategy :
11
12
matrix :
12
13
include :
37
38
run : cd scripts && pnpm run build
38
39
39
40
- name : Monitor Metrics
41
+ id : monitor
40
42
run : |
41
43
result=$(cd scripts && MONITOR=1 node ./dist/compare.js ${{ matrix.product }})
42
44
echo "$result"
45
47
echo "Some benchmark metrics exceed the threshold, please visit the previous step for more information"
46
48
exit 1
47
49
fi
50
+ - name : Create Issue on Failure
51
+ if : failure()
52
+ uses : actions/github-script@v6
53
+ with :
54
+ github-token : ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }}
55
+ script : |
56
+ const diffResult = `${{ steps.monitor.outputs.diff-result }}`
57
+ let result = "task ${{ steps.monitor.outputs.result }}"
58
+ if (diffResult) {
59
+ result = diffResult.replace(/@@/g, "\n");
60
+ }
61
+ const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
62
+ const urlLink = `[Open](${url})`
63
+ const issueTitle = `Benchmark Performance Degradation`
64
+ const issueBody = `
65
+ 📝 Benchmark detail: ${urlLink}
66
+
67
+ ${result}
68
+ `
69
+
70
+ let repo = context.repo.repo
71
+ const product = "${{ matrix.product }}"
72
+ if (product === "MODERNJS_FRAMEWORK" || product === "MODERNJS_MODULE") {
73
+ repo = "modern.js"
74
+ } else if (product === "RSBUILD") {
75
+ repo = "rsbuild"
76
+ } else if (product === "RSPRESS") {
77
+ repo = "rspress"
78
+ }
79
+
80
+ await github.rest.issues.create({
81
+ owner: context.repo.owner,
82
+ repo: repo,
83
+ title: issueTitle,
84
+ body: issueBody,
85
+ });
You can’t perform that action at this time.
0 commit comments