-
Notifications
You must be signed in to change notification settings - Fork 1.4k
50 lines (47 loc) · 1.76 KB
/
perf.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
name: run-performance-tests
on:
pull_request:
types: [ labeled ]
jobs:
test:
runs-on: ubuntu-22.04
if: ${{ github.event.label.name == 'Run Performance Tests' }}
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: ci/test
uses: ./.github/actions/test
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: test-artifcats-${{ github.run_id }}
path: pathToTestResults # Path to test results saved from the performance test
create-comment:
runs-on: ubuntu-22.04
needs: test
steps:
- name: Download test artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: test-artifcats-${{ github.run_id }}
path: pathToTestResults # Download the test results
- name: parse-results
run: |
# Parse test results if necessary
# Or if the output generted by the test is in a format that can be used to create a comment
# we can simply remove this step and use the output from the test durectly.
#
# Echo to github output
# echo "COMMENT_BODY=$(cat body.txt)" >> $GITHUB_OUTPUT
- name: Create comment
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '${{ steps.parse-results.outputs.COMMENT_BODY }}'
})