-
-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (115 loc) · 3.75 KB
/
bench.yml
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
name: Benchmark
on:
push:
branches: [main]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
nvim:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: MunifTanjim/setup-neovim-action@v1
with:
tag: v0.10.2
- name: Run Neovim
run: nvim --headless "+Lazy! sync" +qa
env:
XDG_CONFIG_HOME: ${{ github.workspace }}/.config
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Setup GOBIN
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install vim-startuptime
run: go install github.com/rhysd/vim-startuptime@latest
- name: Setup .config/nvim
run: |
mkdir -p ~/.config
cp -r .config/nvim ~/.config
- name: Run vim-startuptime
run: |
vim-startuptime -vimpath nvim "+Lazy! sync" | \
tee full.txt | \
awk '/Total Average/ {print $3}' | \
jq -R '{"name": "Neovim Total Average Startup Time", "unit": "msec", "value": (. | tonumber)}' | \
jq -s . > nvim-bench.json
env:
XDG_CONFIG_HOME: ${{ github.workspace }}/.config
- name: Show benchmark result
run: cat full.txt
- uses: actions/upload-artifact@v4
with:
name: nvim-bench
path: nvim-bench.json
compression-level: 0
zsh:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Zsh
run: sudo apt-get update && sudo apt-get install -y zsh
- name: Show Zsh version
run: zsh --version
- name: Setup config files
run: |
cp .bash_profile ~/
cp .zshenv ~/
cp .zshrc ~/
mkdir -p ~/.config
cp -r .config/shell ~/.config
- name: Isolate plugin installation from benchmark
run: zsh -c "exit"
- name: Setup zsh-bench
run: git clone https://github.com/romkatv/zsh-bench
- name: Run zsh-bench
run: |
./zsh-bench/zsh-bench | \
tee full.txt | \
tail -n 5 | \
sed 's/_ms//' | \
awk -F '=' '{print "{\"name\": \"Zsh: " $1 "\", \"unit\": \"ms\", \"value\": " $2 "}"}' | \
jq -s . > zsh-bench.json
- name: Show benchmark result
run: cat full.txt
- uses: actions/upload-artifact@v4
with:
name: zsh-bench
path: zsh-bench.json
compression-level: 0
upload:
runs-on: ubuntu-24.04
needs: [nvim, zsh]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: *-bench
- name: Merge benchmark results
run: jq -s 'add' *-bench.json > bench.json
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Neovim Benchmark
tool: 'customSmallerIsBetter'
output-file-path: bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/main' }}