-
Notifications
You must be signed in to change notification settings - Fork 248
66 lines (54 loc) · 1.9 KB
/
Copy pathbenchmark.yaml
File metadata and controls
66 lines (54 loc) · 1.9 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
name: Benchmark
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Every Sunday at midnight
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
deployments: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Python dependencies
run: pip install gitpython semver coloredlogs
- name: Run benchmark
run: python -m benchmark run
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark/results/benchmark.json
- name: Commit benchmark results to repo
run: |
cp benchmark/results/benchmark.json docs/public/data/benchmark.json
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/public/data/benchmark.json
git diff --cached --quiet || git commit -m "chore: update benchmark results"
git push
# Deploy site with fresh benchmark data
# (GITHUB_TOKEN commits don't trigger other workflows, so we deploy here directly)
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install site dependencies
working-directory: docs
run: npm ci
- name: Build site
working-directory: docs
run: npm run build
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
command: pages deploy docs/dist --project-name=githacker --branch=main --commit-dirty=true
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}