-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (88 loc) · 2.78 KB
/
daily-benchmarks.yml
File metadata and controls
107 lines (88 loc) · 2.78 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
name: Daily SQLite Benchmarks
on:
schedule:
# Run daily at 2:00 AM UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual triggering
push:
branches:
- main
paths:
- 'benchmark.js'
- '.github/workflows/daily-benchmarks.yml'
permissions:
contents: write
jobs:
benchmark:
name: Run Benchmarks on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22, 24, 'latest']
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 python3-dev
- name: Install npm dependencies
run: npm install
- name: Run benchmarks
run: npm run benchmark
continue-on-error: true
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results-node-${{ matrix.node-version }}
path: benchmark_results_node_*.json
if-no-files-found: warn
consolidate:
name: Consolidate Results and Update README
needs: benchmark
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download all benchmark results
uses: actions/download-artifact@v4
with:
path: benchmark-artifacts
- name: Consolidate benchmark results
run: |
# Move all JSON files to root directory
find benchmark-artifacts -name "*.json" -exec cp {} . \;
# List all result files
ls -la benchmark_results_*.json || echo "No benchmark result files found"
- name: Install dependencies for update script
run: npm install
- name: Generate updated README
run: node scripts/update-readme.js
- name: Configure Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Commit and push changes
run: |
git add benchmark_results_*.json README.md
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update benchmark results [skip ci]"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}