Skip to content

ci: bring git-auto-commit-action to v5 #71

ci: bring git-auto-commit-action to v5

ci: bring git-auto-commit-action to v5 #71

Workflow file for this run

name: CI
on:
push:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: >
SKIP="no-commit-to-branch" pre-commit run --all-files --show-diff-on-failure
--color=always
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
if [ "$newfiles" != "" ] ; then
echo "Please check-in the following files:"
echo "$newfiles"
exit 1
fi
tests:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- uses: actions/checkout@v4
- name: Install Neovim
shell: bash
run: |
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
- name: Run Tests
run: |
nvim --version
[ ! -d tests ] && exit 0
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}"
extras:
runs-on: ubuntu-latest
needs:
- tests
- pre-commit
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Install Neovim
shell: bash
run: |
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
- uses: actions/checkout@v4
- name: Build Extras
run: |
nvim -u NONE -E -R --headless --cmd "set rtp^=." --cmd "packloadall" --cmd "lua require('modus-themes.extras').setup()" --cmd qa
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(build): auto-generate extras"
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>"
docs:
runs-on: ubuntu-latest
needs:
- pre-commit
- tests
- extras
if: ${{ github.ref == 'refs/heads/master' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: git pull
- name: panvimdoc
uses: kdheepak/[email protected]
with:
vimdoc: modus-themes.nvim
version: "Neovim >= 0.8.0"
toc: true
demojify: true
treesitter: true
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(build): auto-generate vimdoc"
commit_options: "--no-verify --signoff"
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>"