From 0a85b99d86249fef2f29c541a0cd8b067790fb7e Mon Sep 17 00:00:00 2001 From: Galvarcus <117151435+Galvarcus@users.noreply.github.com> Date: Sat, 26 Sep 2026 20:04:26 -0400 Subject: [PATCH 1/2] Create vimdoc.yml --- .github/workflows/vimdoc.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/vimdoc.yml diff --git a/.github/workflows/vimdoc.yml b/.github/workflows/vimdoc.yml new file mode 100644 index 0000000..e93b7e1 --- /dev/null +++ b/.github/workflows/vimdoc.yml @@ -0,0 +1,51 @@ +name: Generate Vimdoc +on: + push: + branches: + - main + - Development + paths: + - README.md + - doc/pandoc.yaml + - doc/vimdoc-filter.lua + - .github/workflows/vimdoc.yml + workflow_dispatch: +permissions: + contents: write +jobs: + vimdoc: + name: Generate Vimdoc + runs-on: ubuntu-latest + # A manual run on another branch must not commit to it. + if: github.ref_name == 'main' || github.ref_name == 'Development' + steps: + - name: Checkout + uses: actions/checkout@v4 + + # The vimdoc writer needs Pandoc 3.8.1 or later. + - name: Generate Vimdoc + uses: docker://pandoc/core:3.8 + with: + args: >- + README.md + --from=markdown + --to=vimdoc + --standalone + --columns=78 + --toc=true + --metadata-file=doc/pandoc.yaml + --lua-filter=doc/vimdoc-filter.lua + --output=doc/logger.txt + + # A push with GITHUB_TOKEN does not start this workflow again. + - name: Commit generated Vimdoc + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add doc/logger.txt + if git diff --cached --quiet; then + echo "doc/logger.txt is current." + exit 0 + fi + git commit -m "docs: regenerate Vimdoc" + git push origin HEAD:${{ github.ref_name }} From dfe16c24816f5d219d87a3d7e2b87f980fc581ba Mon Sep 17 00:00:00 2001 From: Galvarcus <117151435+Galvarcus@users.noreply.github.com> Date: Sat, 26 Sep 2026 20:05:56 -0400 Subject: [PATCH 2/2] Create tests.yml --- .github/workflows/tests.yml | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..7dc45da --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,70 @@ +name: Tests +on: + push: + branches: + - main + - Development + paths: + - import/** + - plugin/** + - tests/** + - .github/workflows/tests.yml + pull_request: + paths: + - import/** + - plugin/** + - tests/** + - .github/workflows/tests.yml + workflow_dispatch: +permissions: + contents: read +jobs: + test: + name: Tests on Vim ${{ matrix.vim }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # latest is the newest build. v9.1.0016 is the oldest AppImage of + # Vim 9.1, the minimum version Logger supports. + vim: [latest, v9.1.0016] + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Distro packages of Vim lag behind upstream. vim/vim-appimage + # publishes prebuilt AppImages, so no build from source is needed. + - name: Install Vim + env: + GH_TOKEN: ${{ github.token }} + run: | + if [ "${{ matrix.vim }}" = latest ]; then + api=https://api.github.com/repos/vim/vim-appimage/releases/latest + else + api=https://api.github.com/repos/vim/vim-appimage/releases/tags/${{ matrix.vim }} + fi + url=$(curl -s -H "Authorization: Bearer $GH_TOKEN" "$api" \ + | jq -r '.assets[] | select(.name | test("^Vim-v.*-x86_64\\.AppImage$")) | .browser_download_url') + curl -sL -o /tmp/vim.appimage "$url" + chmod +x /tmp/vim.appimage + cd /tmp && ./vim.appimage --appimage-extract + ln -s /tmp/squashfs-root/AppRun /tmp/squashfs-root/vim + echo "/tmp/squashfs-root" >> "$GITHUB_PATH" + + - name: Vim version + run: vim --version + + # -es mode hides all errors. The verbose log shows why Vim stopped + # when it did not write the results file. + - name: Run tests + run: | + vim -es -u NONE -N -V20/tmp/vim.log \ + -c 'set rtp+=.' \ + -c 'source tests/harness.vim' -c 'quit' || true + if [ ! -f tests/results.txt ]; then + echo "::error::tests/results.txt was not created. Verbose log follows." + cat /tmp/vim.log + exit 1 + fi + cat tests/results.txt + grep -qx 'All tests passed' tests/results.txt