2022-11-29 22:40:13 +08:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2022-12-20 15:56:59 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# os: [ubuntu-latest, windows-latest]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-11-29 22:40:13 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Neovim
|
2022-12-20 15:56:59 +08:00
|
|
|
shell: bash
|
2022-11-29 22:40:13 +08:00
|
|
|
run: |
|
2023-03-20 03:57:12 +08:00
|
|
|
mkdir -p /tmp/nvim
|
|
|
|
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
|
|
|
|
cd /tmp/nvim
|
|
|
|
chmod a+x ./nvim.appimage
|
|
|
|
./nvim.appimage --appimage-extract
|
|
|
|
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
|
2022-11-29 22:40:13 +08:00
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
|
|
|
nvim --version
|
2023-01-05 03:23:36 +08:00
|
|
|
[ ! -d tests ] && exit 0
|
|
|
|
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}"
|
2022-11-29 22:40:13 +08:00
|
|
|
docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: tests
|
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: panvimdoc
|
|
|
|
uses: kdheepak/panvimdoc@main
|
|
|
|
with:
|
|
|
|
vimdoc: lazy.nvim
|
2022-12-15 16:15:55 +08:00
|
|
|
version: "Neovim >= 0.8.0"
|
2022-11-29 22:40:13 +08:00
|
|
|
demojify: true
|
2022-12-30 15:39:18 +08:00
|
|
|
treesitter: true
|
2022-11-29 22:40:13 +08:00
|
|
|
- name: Push changes
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
with:
|
|
|
|
commit_message: "chore(build): auto-generate vimdoc"
|
|
|
|
commit_user_name: "github-actions[bot]"
|
|
|
|
commit_user_email: "github-actions[bot]@users.noreply.github.com"
|
|
|
|
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
|
|
|
|
release:
|
|
|
|
name: release
|
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
|
|
needs:
|
|
|
|
- docs
|
|
|
|
- tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: google-github-actions/release-please-action@v3
|
2022-12-30 06:26:27 +08:00
|
|
|
id: release
|
2022-11-29 22:40:13 +08:00
|
|
|
with:
|
2022-11-29 22:48:27 +08:00
|
|
|
release-type: simple
|
2022-11-29 22:55:46 +08:00
|
|
|
package-name: lazy.nvim
|
2023-01-10 16:28:54 +08:00
|
|
|
extra-files: |
|
|
|
|
lua/lazy/core/config.lua
|
2023-01-24 03:49:44 +08:00
|
|
|
- uses: actions/checkout@v3
|
2022-12-30 05:58:10 +08:00
|
|
|
- name: tag stable versions
|
2022-12-30 06:26:27 +08:00
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
2022-12-30 05:58:10 +08:00
|
|
|
run: |
|
|
|
|
git config user.name github-actions[bot]
|
|
|
|
git config user.email github-actions[bot]@users.noreply.github.com
|
|
|
|
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
|
|
|
|
git tag -d stable || true
|
|
|
|
git push origin :stable || true
|
|
|
|
git tag -a stable -m "Last Stable Release"
|
|
|
|
git push origin stable
|