Skip to content

CI: simpler jq command #13

CI: simpler jq command

CI: simpler jq command #13

Workflow file for this run

name: Benchmark

Check failure on line 1 in .github/workflows/bench.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/bench.yml

Invalid workflow file

You have an error in your yaml syntax
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' }}