-
Notifications
You must be signed in to change notification settings - Fork 439
64 lines (54 loc) · 2.11 KB
/
benchmark-release.yml
File metadata and controls
64 lines (54 loc) · 2.11 KB
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
name: Run Perf benchmarks
on:
push:
branches:
- winter*
- spring*
- summer*
- wjh/perf-ci # Just for testing
jobs:
run-performance-tests:
# It is important to use this image so that we have a consistent IP address
runs-on: salesforce-Ubuntu
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.18.1'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get Previous Release
id: previous_release
run: |
# Parse current season and year from branch name
if [[ "$GITHUB_REF_NAME" =~ ^(winter|spring|summer)([0-9]+)$ ]]; then
season="${BASH_REMATCH[1]}"
year="${BASH_REMATCH[2]}"
else
echo "JUST FOR TESTING"
echo "branch=master" >> "$GITHUB_OUTPUT"
exit 0
fi
# Get previous season and year
case $season in
winter) PREVIOUS="summer$((year - 1))";;
spring) PREVIOUS="winter$year";;
summer) PREVIOUS="spring$year";;
esac
# Expose to GitHub Actions
echo "branch=$PREVIOUS" >> "$GITHUB_OUTPUT"
- name: Build benchmarks
env:
BENCHMARK_REF: ${{steps.previous_release.outputs.branch}}
run: yarn build:performance
- name: Run benchmarks
working-directory: ./packages/@lwc/perf-benchmarks
env:
BENCHMARK_REF: ${{steps.previous_release.outputs.branch}}
run: yarn test:run
- name: Format results
working-directory: ./packages/@lwc/perf-benchmarks
run: yarn --silent test:format >> "$GITHUB_STEP_SUMMARY"