summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Arcangeli <506791+stevearc@users.noreply.github.com>2023-08-31 10:51:22 -0700
committerGitHub <noreply@github.com>2023-08-31 10:51:22 -0700
commit143fbdb6b72d2eeccfcdbad305c20f4a06af3633 (patch)
treebbff8d2afbcb36fde9dcfd8f6361b1ded1efb753
parenteb3ebb6d2d114f6476a8f8d21d74f99c6d231a53 (diff)
ci: improve consistency of CI workflows (#23)
* ci: don't double-run tests on PRs * ci: always run document generation and lint
-rw-r--r--.github/workflows/tests.yml21
-rw-r--r--Makefile7
2 files changed, 16 insertions, 12 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index be19573..843ba73 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,6 +1,12 @@
name: Run tests
-on: [push, pull_request]
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
jobs:
luacheck:
@@ -64,20 +70,20 @@ jobs:
update_docs:
name: Update docs
- if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- with:
- submodules: true
- name: Install Neovim and dependencies
- env:
- NVIM_TAG: v0.9.1
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: |
@@ -87,9 +93,6 @@ jobs:
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
- make doc
- python scripts/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})
diff --git a/Makefile b/Makefile
index 6854c01..7594e51 100644
--- a/Makefile
+++ b/Makefile
@@ -4,18 +4,19 @@ 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 lua
+
fastlint: scripts/nvim_doc_tools
python scripts/main.py lint
luacheck lua tests --formatter plain
stylua --check lua tests
-lint: scripts/nvim-typecheck-action fastlint
- ./scripts/nvim-typecheck-action/typecheck.sh lua
-
scripts/nvim_doc_tools:
git clone https://github.com/stevearc/nvim_doc_tools scripts/nvim_doc_tools