Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions .github/workflows/vimdoc.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading