|
1 | 1 | name: Reassure Performance Tests |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - types: [opened, synchronize] |
6 | | - branches-ignore: [staging, production] |
7 | | - paths-ignore: [tests/**, '**.md', '**.sh'] |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
| 6 | + branches-ignore: [staging, production] |
| 7 | + paths-ignore: ['**.md', '**.sh'] |
| 8 | + |
8 | 9 | jobs: |
9 | | - perf-tests: |
10 | | - if: ${{ github.actor != 'OSBotify' }} |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - name: Checkout |
14 | | - # v4 |
15 | | - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 |
16 | | - with: |
17 | | - fetch-depth: 0 |
| 10 | + # Note: We run baseline and delta performance checks in the same runner to reduce hardware variance across machines |
| 11 | + perf-tests: |
| 12 | + if: ${{ github.actor != 'OSBotify' }} |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + # v4 |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 |
| 18 | + with: |
| 19 | + ref: ${{ github.event.pull_request.base.ref }} |
| 20 | + |
| 21 | + # v4 |
| 22 | + - name: Setup Node |
| 23 | + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e |
| 24 | + with: |
| 25 | + node-version-file: '.nvmrc' |
| 26 | + |
| 27 | + - name: Run reassure baseline tests |
| 28 | + run: npx reassure --baseline |
| 29 | + |
| 30 | + - name: Checkout PR head ref |
| 31 | + run: | |
| 32 | + git fetch origin ${{ github.event.pull_request.head.ref }} --no-tags --depth=1 |
| 33 | + git switch --force --detach ${{ github.event.pull_request.head.ref }} |
| 34 | + |
| 35 | + - name: Reinstall node_modules |
| 36 | + run: npm install --force |
18 | 37 |
|
19 | | - - name: Setup Node |
20 | | - # v4 |
21 | | - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e |
22 | | - with: |
23 | | - node-version-file: '.nvmrc' |
| 38 | + - name: Run reassure delta tests |
| 39 | + run: npx reassure --branch |
24 | 40 |
|
25 | | - - name: Set dummy git credentials |
26 | | - run: | |
27 | | - git config --global user.email "test@test.com" |
28 | | - git config --global user.name "Test" |
29 | | - - name: Run performance testing script |
30 | | - shell: bash |
31 | | - run: | |
32 | | - set -e |
33 | | - BASELINE_BRANCH=${BASELINE_BRANCH:="main"} |
34 | | - git fetch origin "$BASELINE_BRANCH" --no-tags --depth=1 |
35 | | - git switch "$BASELINE_BRANCH" |
36 | | - npm install --force |
37 | | - npm install reassure |
38 | | - npx reassure --baseline |
39 | | - git switch --force --detach - |
40 | | - npm install --force |
41 | | - npm install reassure |
42 | | - npx reassure --branch |
43 | | - - name: Validate output.json |
44 | | - id: validateReassureOutput |
45 | | - uses: ./.github/actions/javascript/validateReassureOutput |
46 | | - with: |
47 | | - DURATION_DEVIATION_PERCENTAGE: 20 |
| 41 | + - name: Validate output.json |
| 42 | + id: validateReassureOutput |
| 43 | + uses: ./.github/actions/javascript/validateReassureOutput |
| 44 | + with: |
| 45 | + DURATION_DEVIATION_PERCENTAGE: 20 |
0 commit comments