-
Notifications
You must be signed in to change notification settings - Fork 23
85 lines (73 loc) · 2.15 KB
/
regression.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Regression
on:
push:
branches-ignore:
- 'main'
permissions:
contents: read
pull-requests: write
jobs:
regression:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Regression
run: |
node .github/regression/regression.js
- name: Performance
run: |
cp .github/regression/performance.js ../../performance.js
npm run install && npm run link-local && npm run performance
cp build/performance/results.json ../../results_after.json
git checkout -f main
git reset --hard
git status
npm run install && npm run link-local && npm run performance
cp build/performance/results.json ../../results_before.json
- name: cat
run: |
cat ../../results_after.json
cat ../../results_before.json
- name: Build performance comment
run: |
cd .. && cd ..
ls -salh
node ./performance.js
- uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ steps.findPr.outputs.pr }}
- name: Find Comment
if: steps.findPr.outputs.pr != ''
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: '${{steps.findPr.outputs.pr}}'
body-includes: Performance test results
- run: echo ${{ steps.fc.outputs.comment-id }}
- name: Build body from file
if: steps.findPr.outputs.pr != ''
id: get-comment-body
run: |
ls -salh
cp comment-regression.txt ../../
cd .. && cd ..
ls -salh
cat comment-regression.txt comment-performance.txt > body.txt
- name: Create comment
if: steps.findPr.outputs.pr != ''
uses: peter-evans/create-or-update-comment@v4
id: create-comment
with:
issue-number: '${{steps.findPr.outputs.pr}}'
edit-mode: replace
comment-id: '${{steps.fc.outputs.comment-id}}'
body-path: ../../body.txt