Skip to content

Commit 7c2005c

Browse files
committed
chore(ci): run perf testing on release branches
1 parent 6bec826 commit 7c2005c

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Run Perf benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- winter*
7+
- spring*
8+
- summer*
9+
- wjh/perf-ci # Just for testing
10+
11+
jobs:
12+
run-performance-tests:
13+
# It is important to use this image so that we have a consistent IP address
14+
runs-on: salesforce-Ubuntu
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.18.1'
23+
cache: 'yarn'
24+
25+
- name: Install dependencies
26+
run: yarn install --frozen-lockfile
27+
28+
- name: Get Previous Release
29+
id: previous_release
30+
run: |
31+
# Parse current season and year
32+
[[ $release =~ ^(winter|spring|summer)([0-9]+)$ ]]
33+
season="${BASH_REMATCH[1]}"
34+
year="${BASH_REMATCH[2]}"
35+
36+
# Get previous season and year
37+
case $season in
38+
winter) PREVIOUS="summer$((year - 1))";;
39+
spring) PREVIOUS="winter$year";;
40+
summer) PREVIOUS="spring$year";;
41+
*) PREVIOUS="master";; # Just for testing
42+
esac
43+
# Expose to GitHub Actions
44+
echo "branch=$PREVIOUS" >> "$GITHUB_OUTPUT"
45+
46+
- name: Build benchmarks
47+
env:
48+
BENCHMARK_REF: ${{steps.previous_release.outputs.branch}}
49+
run: yarn build:performance
50+
51+
- name: Run benchmarks
52+
working-directory: ./packages/@lwc/perf-benchmarks
53+
env:
54+
BENCHMARK_REF: ${{steps.previous_release.outputs.branch}}
55+
run: yarn test:run
56+
57+
- name: Format results
58+
working-directory: ./packages/@lwc/perf-benchmarks
59+
run: yarn --silent test:format >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)