Initial commit
This commit is contained in:
commit
3d1193c5c9
9 files changed
+812
No files matched your search
@@ -0,0 +1,78 @@
|
||||
name: CI
|
||||
|
||||
# Pull requests into main: formatting (StyLua, .stylua.toml), and the smoke
|
||||
# test (tests/smoke.lua) on the oldest Neovim the README supports and the
|
||||
# current stable. Versions are pinned, with checksums, so a new release
|
||||
# can't fail CI on its own.
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
format:
|
||||
name: StyLua
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install StyLua
|
||||
run: |
|
||||
set -eo pipefail
|
||||
V=2.5.2
|
||||
case "$(uname -m)" in
|
||||
x86_64) A=x86_64; SUM=bcb0d855e91f102f28a370e850f8566b3b44b79e6274d806ea5246837c0fd5ab ;;
|
||||
aarch64) A=aarch64; SUM=0ef2ebf0b7e5a652b65c4cb96c6d9ffb3981a98547de3c764465bbf54a8d761a ;;
|
||||
*) echo "::error::no StyLua for $(uname -m)"; exit 1 ;;
|
||||
esac
|
||||
F="stylua-linux-$A.zip"
|
||||
curl -fsSL -o "$RUNNER_TEMP/$F" "https://github.com/JohnnyMorganz/StyLua/releases/download/v$V/$F"
|
||||
echo "$SUM $RUNNER_TEMP/$F" | sha256sum -c -
|
||||
unzip -q "$RUNNER_TEMP/$F" -d "$RUNNER_TEMP/stylua"
|
||||
install "$RUNNER_TEMP/stylua/stylua" /usr/local/bin/
|
||||
|
||||
- name: Check
|
||||
run: |
|
||||
if ! stylua --check .; then
|
||||
echo "::error::not StyLua-formatted (run stylua .)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test:
|
||||
name: Smoke test (Neovim ${{ matrix.nvim }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- nvim: 0.11.7
|
||||
x86_64: 38a7c6317f94503841096c00e8fde05ef04b9472fc9d7d62b6e033cecd6f7991
|
||||
arm64: 99bb3c53604e83ce18fc0b459e34cf1a5e212f4e5fbe2eb136b3c18092ae9905
|
||||
- nvim: 0.12.5
|
||||
x86_64: bce0f56eda1f1b1db6eee8f4133d7a38813ea07933837dd1777411ca384c6875
|
||||
arm64: 1aa5ca085249580ae0f91eb14f27ec0919773ff2d99a163d03f3d6c21ac29725
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Neovim
|
||||
env:
|
||||
V: ${{ matrix.nvim }}
|
||||
SUM_X86_64: ${{ matrix.x86_64 }}
|
||||
SUM_ARM64: ${{ matrix.arm64 }}
|
||||
run: |
|
||||
set -eo pipefail
|
||||
case "$(uname -m)" in
|
||||
x86_64) A=x86_64; SUM=$SUM_X86_64 ;;
|
||||
aarch64) A=arm64; SUM=$SUM_ARM64 ;;
|
||||
*) echo "::error::no Neovim for $(uname -m)"; exit 1 ;;
|
||||
esac
|
||||
F="nvim-linux-$A.tar.gz"
|
||||
curl -fsSL -o "$RUNNER_TEMP/$F" "https://github.com/neovim/neovim/releases/download/v$V/$F"
|
||||
echo "$SUM $RUNNER_TEMP/$F" | sha256sum -c -
|
||||
tar -xzf "$RUNNER_TEMP/$F" -C "$RUNNER_TEMP"
|
||||
echo "$RUNNER_TEMP/nvim-linux-$A/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Smoke test
|
||||
run: nvim --clean -l tests/smoke.lua
|
||||
@@ -0,0 +1,40 @@
|
||||
name: PR title
|
||||
|
||||
# Pull requests are squash-merged, so the title becomes the commit on main:
|
||||
# it must start with a conventional commit type, so that release notes can
|
||||
# be written from main's history (git-cliff, as lazysecrets does). Brackets
|
||||
# and a missing space are fine too.
|
||||
#
|
||||
# feat: SOPS and .env files in git repos
|
||||
# fix(search): ctrl+r with empty results loads the scope
|
||||
# feat!: rename config keys (! marks a breaking change)
|
||||
# [feat] install with a one-liner
|
||||
# [fix]: hide values on blur
|
||||
# docs:split the README
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
types: [opened, edited, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
title:
|
||||
name: Conventional title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check the title
|
||||
env:
|
||||
TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
types='feat|fix|perf|refactor|docs|test|ci|chore|build|style|revert'
|
||||
scope='(\([a-z0-9._/-]+\))?'
|
||||
if [[ "$TITLE" =~ ^\[($types)$scope!?\]!?:?[[:space:]]*(.*)$ ]] ||
|
||||
[[ "$TITLE" =~ ^($types)$scope!?:[[:space:]]*(.*)$ ]]; then
|
||||
what="${BASH_REMATCH[3]}"
|
||||
fi
|
||||
if [[ "${what:-}" =~ [^[:space:]] ]]; then
|
||||
echo "ok: $TITLE"
|
||||
else
|
||||
echo "::error::The title should start with a type, like \"feat: what changed\" or \"[feat] what changed\"; types: ${types//|/, }. Got: $TITLE"
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user