ci: merge workflow jobs and add makefile

This commit is contained in:
Steven Arcangeli 2023-09-02 08:44:56 -07:00
parent 7033d52db0
commit ca2560cae8
12 changed files with 86 additions and 51 deletions

View file

@ -3,7 +3,7 @@ set -e
PLUGINS="$HOME/.local/share/nvim/site/pack/plugins/start"
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
./nvim.appimage --appimage-extract >/dev/null
rm -f nvim.appimage

View file

@ -1,6 +1,12 @@
name: Tests
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
luacheck:
@ -17,7 +23,7 @@ jobs:
sudo luarocks install luacheck
- name: Run Luacheck
run: luacheck .
run: luacheck lua tests
stylua:
name: StyLua
@ -29,7 +35,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v0.15.2
args: --check .
args: --check lua tests
typecheck:
name: typecheck
@ -62,6 +68,35 @@ jobs:
run: |
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:
name: release
@ -71,6 +106,7 @@ jobs:
- stylua
- typecheck
- run_tests
- update_docs
runs-on: ubuntu-22.04
steps:
- uses: google-github-actions/release-please-action@v3

View file

@ -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.9.0
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})