mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-08 02:35:44 +02:00
ci: merge workflows and add makefile
This commit is contained in:
parent
dc17cfd401
commit
fc04a097d0
9 changed files with 79 additions and 47 deletions
4
.github/pre-commit
vendored
4
.github/pre-commit
vendored
|
@ -1,5 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
luacheck lua tests
|
make fastlint
|
||||||
|
|
||||||
stylua --check .
|
|
||||||
|
|
14
.github/pre-push
vendored
14
.github/pre-push
vendored
|
@ -1,7 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
luacheck lua tests
|
IFS=' '
|
||||||
|
while read local_ref _local_sha _remote_ref _remote_sha; do
|
||||||
stylua --check .
|
remote_main=$( (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo "///master") | cut -f 4 -d / | tr -d "[:space:]")
|
||||||
|
local_ref_short=$(echo "$local_ref" | cut -f 3 -d / | tr -d "[:space:]")
|
||||||
lua-typecheck lua
|
if [ "$local_ref_short" = "$remote_main" ]; then
|
||||||
|
make lint
|
||||||
|
make test
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
2
.github/workflows/install_nvim.sh
vendored
2
.github/workflows/install_nvim.sh
vendored
|
@ -3,7 +3,7 @@ set -e
|
||||||
PLUGINS="$HOME/.local/share/nvim/site/pack/plugins/start"
|
PLUGINS="$HOME/.local/share/nvim/site/pack/plugins/start"
|
||||||
mkdir -p "$PLUGINS"
|
mkdir -p "$PLUGINS"
|
||||||
|
|
||||||
wget "https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage"
|
wget "https://github.com/neovim/neovim/releases/download/${NVIM_TAG-stable}/nvim.appimage"
|
||||||
chmod +x nvim.appimage
|
chmod +x nvim.appimage
|
||||||
./nvim.appimage --appimage-extract >/dev/null
|
./nvim.appimage --appimage-extract >/dev/null
|
||||||
rm -f nvim.appimage
|
rm -f nvim.appimage
|
||||||
|
|
42
.github/workflows/tests.yml
vendored
42
.github/workflows/tests.yml
vendored
|
@ -1,6 +1,12 @@
|
||||||
name: Run tests
|
name: Run tests
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
luacheck:
|
luacheck:
|
||||||
|
@ -17,7 +23,7 @@ jobs:
|
||||||
sudo luarocks install luacheck
|
sudo luarocks install luacheck
|
||||||
|
|
||||||
- name: Run Luacheck
|
- name: Run Luacheck
|
||||||
run: luacheck .
|
run: luacheck lua tests
|
||||||
|
|
||||||
typecheck:
|
typecheck:
|
||||||
name: typecheck
|
name: typecheck
|
||||||
|
@ -38,7 +44,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
version: v0.15.2
|
version: v0.15.2
|
||||||
args: --check .
|
args: --check lua tests
|
||||||
|
|
||||||
run_tests:
|
run_tests:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -66,6 +72,35 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
bash ./run_tests.sh
|
bash ./run_tests.sh
|
||||||
|
|
||||||
|
update_docs:
|
||||||
|
name: Update docs
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Neovim and dependencies
|
||||||
|
run: |
|
||||||
|
bash ./.github/workflows/install_nvim.sh
|
||||||
|
|
||||||
|
- name: Update docs
|
||||||
|
run: |
|
||||||
|
python -m pip install pyparsing==3.0.9
|
||||||
|
make doc
|
||||||
|
- name: Commit changes
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
COMMIT_MSG: |
|
||||||
|
[docgen] Update docs
|
||||||
|
skip-checks: true
|
||||||
|
run: |
|
||||||
|
git config user.email "actions@github"
|
||||||
|
git config user.name "Github Actions"
|
||||||
|
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
|
||||||
|
git add README.md doc
|
||||||
|
# Only commit and push if we have changes
|
||||||
|
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: release
|
name: release
|
||||||
|
|
||||||
|
@ -75,6 +110,7 @@ jobs:
|
||||||
- stylua
|
- stylua
|
||||||
- run_tests
|
- run_tests
|
||||||
- typecheck
|
- typecheck
|
||||||
|
- update_docs
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: google-github-actions/release-please-action@v3
|
- uses: google-github-actions/release-please-action@v3
|
||||||
|
|
35
.github/workflows/update-docs.yml
vendored
35
.github/workflows/update-docs.yml
vendored
|
@ -1,35 +0,0 @@
|
||||||
name: Update docs
|
|
||||||
|
|
||||||
on: push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-readme:
|
|
||||||
name: Update docs
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Install Neovim and dependencies
|
|
||||||
env:
|
|
||||||
NVIM_TAG: v0.8.3
|
|
||||||
run: |
|
|
||||||
bash ./.github/workflows/install_nvim.sh
|
|
||||||
|
|
||||||
- name: Update docs
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
COMMIT_MSG: |
|
|
||||||
[docgen] Update docs
|
|
||||||
skip-checks: true
|
|
||||||
run: |
|
|
||||||
git config user.email "actions@github"
|
|
||||||
git config user.name "Github Actions"
|
|
||||||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
|
|
||||||
python -m pip install pyparsing==3.0.9
|
|
||||||
python .github/main.py generate
|
|
||||||
python .github/main.py lint
|
|
||||||
git add README.md doc
|
|
||||||
# Only commit and push if we have changes
|
|
||||||
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -42,3 +42,5 @@ luac.out
|
||||||
.direnv/
|
.direnv/
|
||||||
.testenv/
|
.testenv/
|
||||||
doc/tags
|
doc/tags
|
||||||
|
scripts/nvim_doc_tools
|
||||||
|
scripts/nvim-typecheck-action
|
||||||
|
|
27
Makefile
Normal file
27
Makefile
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
.PHONY: all doc test lint fastlint clean
|
||||||
|
|
||||||
|
all: doc lint test
|
||||||
|
|
||||||
|
doc: scripts/nvim_doc_tools
|
||||||
|
python scripts/main.py generate
|
||||||
|
python scripts/main.py lint
|
||||||
|
|
||||||
|
test:
|
||||||
|
./run_tests.sh
|
||||||
|
|
||||||
|
lint: scripts/nvim-typecheck-action fastlint
|
||||||
|
./scripts/nvim-typecheck-action/typecheck.sh --workdir scripts/nvim-typecheck-action lua
|
||||||
|
|
||||||
|
fastlint: scripts/nvim_doc_tools
|
||||||
|
python scripts/main.py lint
|
||||||
|
luacheck lua tests --formatter plain
|
||||||
|
stylua --check lua tests
|
||||||
|
|
||||||
|
scripts/nvim_doc_tools:
|
||||||
|
git clone https://github.com/stevearc/nvim_doc_tools scripts/nvim_doc_tools
|
||||||
|
|
||||||
|
scripts/nvim-typecheck-action:
|
||||||
|
git clone https://github.com/stevearc/nvim-typecheck-action scripts/nvim-typecheck-action
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf scripts/nvim_doc_tools scripts/nvim-typecheck-action
|
Loading…
Reference in a new issue