Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nvim: continuous benchmarks #64

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
-- Load Vim configuration
vim.cmd("set runtimepath^=~/.config/vim runtimepath+=~/.config/vim/after")
local config_home = os.getenv("XDG_CONFIG_HOME") or "~/.config"
vim.cmd("set runtimepath^=" .. config_home .. "/vim runtimepath+=" .. config_home .. "/vim/after")
vim.o.packpath = vim.o.runtimepath
vim.cmd("source ~/.config/vim/vimrc")
vim.cmd("source " .. config_home .. "/vim/vimrc")

-- Enable fast cache loading
if vim.loader then
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/nvim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Neovim

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:
bench:
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@v1
with:
go-version: 1.23.2

- 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 . > startuptime.json
env:
XDG_CONFIG_HOME: ${{ github.workspace }}/.config

- name: Show benchmark result
run: cat full.txt

- 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: startuptime.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/main' }}
Loading