diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2023-08-25 11:15:12 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2023-08-25 11:43:47 -0700 |
commit | eb5987e9dd40ce1e27c9c07e41d09571f1bd876e (patch) | |
tree | b4cffe35e0893272cedc0ecf0229d08be343d70e /.github/workflows | |
parent | 100fd00d40423af85c4c7efcf875f8e4ee329f50 (diff) |
feat: first working version
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/install_nvim.sh | 12 | ||||
-rw-r--r-- | .github/workflows/tests.yml | 65 | ||||
-rw-r--r-- | .github/workflows/update-docs.yml | 35 |
3 files changed, 112 insertions, 0 deletions
diff --git a/.github/workflows/install_nvim.sh b/.github/workflows/install_nvim.sh new file mode 100644 index 0000000..c5119dc --- /dev/null +++ b/.github/workflows/install_nvim.sh @@ -0,0 +1,12 @@ +#!/bin/bash +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" +chmod +x nvim.appimage +./nvim.appimage --appimage-extract >/dev/null +rm -f nvim.appimage +mkdir -p ~/.local/share/nvim +mv squashfs-root ~/.local/share/nvim/appimage +sudo ln -s "$HOME/.local/share/nvim/appimage/AppRun" /usr/bin/nvim diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ca71ef2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,65 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + luacheck: + name: Luacheck + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + sudo apt-get update + sudo add-apt-repository universe + sudo apt install luarocks -y + sudo luarocks install luacheck + + - name: Run Luacheck + run: luacheck . + + typecheck: + name: typecheck + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: stevearc/nvim-typecheck-action@v1 + with: + path: lua + + stylua: + name: StyLua + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Stylua + uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v0.15.2 + args: --check . + + release: + name: release + + if: ${{ github.ref == 'refs/heads/master' }} + needs: + - luacheck + - stylua + - typecheck + runs-on: ubuntu-22.04 + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: simple + package-name: conform.nvim + - uses: actions/checkout@v3 + - uses: rickstaa/action-create-tag@v1 + if: ${{ steps.release.outputs.release_created }} + with: + tag: stable + message: "Current stable release: ${{ steps.release.outputs.tag_name }}" + tag_exists_error: false + force_push_tag: true diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 0000000..813e69c --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,35 @@ +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}) |