-
Notifications
You must be signed in to change notification settings - Fork 2
169 lines (162 loc) · 4.47 KB
/
benchmark.yaml
File metadata and controls
169 lines (162 loc) · 4.47 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Package Manager Benchmarks
on:
push:
workflow_dispatch:
# Prevent multiple runs from interfering with each other
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
name: 'Setup'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Cache Bins
uses: actions/cache@v4
with:
path: bins
key: bins
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '22'
- name: Install & Setup Tools
run: |
bash ./scripts/setup.sh
benchmark:
name: 'Run Benchmarks'
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 30
strategy:
matrix:
project: [next, astro, svelte, vue]
cache: [cold, warm]
include:
- project: next
cache: cold
- project: astro
cache: cold
- project: svelte
cache: cold
- project: vue
cache: cold
- project: next
cache: warm
- project: astro
cache: warm
- project: svelte
cache: warm
- project: vue
cache: warm
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '22'
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq hyperfine
- name: Restore Bins
uses: actions/cache/restore@v4
with:
path: bins
key: bins
- name: Run Project Benchmarks
run: |
if [ "${{ matrix.cache }}" = "warm" ]; then
bash ./scripts/install-warm.sh ${{ matrix.project }}
else
bash ./scripts/install.sh ${{ matrix.project }}
fi
- name: Upload Benchmark Results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ matrix.cache }}-results
path: ./results/${{ matrix.project }}/
retention-days: 7
task:
name: 'Benchmark Running Tasks'
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '22'
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq hyperfine
- name: Restore Bins
uses: actions/cache/restore@v4
with:
path: bins
key: bins
- name: Run Task Execution Benchmarks
run: |
bash ./scripts/run.sh
- name: Upload Benchmark Results
uses: actions/upload-artifact@v4
with:
name: task-benchmark-results
path: ./results/run.json
retention-days: 7
process:
name: 'Process Results'
runs-on: ubuntu-latest
needs: [benchmark, task]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '22'
- name: Download Results
uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: Process Results
run: |
bash ./scripts/process-results.sh
- name: Upload Processed Results
uses: actions/upload-artifact@v4
with:
name: processed-results
path: chart/results/
retention-days: 7
deploy:
name: 'Deploy Results'
runs-on: ubuntu-latest
needs: [process]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Download Results
uses: actions/download-artifact@v4
with:
name: processed-results
path: chart/results/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: chart/results
force_orphan: true
cleanup:
name: 'Cleanup'
needs: [deploy]
runs-on: ubuntu-latest
if: always()
steps:
- name: Delete old artifacts
run: |
gh api repos/${{ github.repository }}/actions/artifacts --paginate | jq -r '.artifacts[] | select(.expired) | .id' | xargs -I {} gh api repos/${{ github.repository }}/actions/artifacts/{} -X DELETE