chore(ci):add basic tests #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
stylua: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Stylua | |
uses: JohnnyMorganz/stylua-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: latest | |
args: --color always --check . | |
selene: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Selene | |
uses: AlejandroSuero/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --display-style=quiet --config .selene.toml . | |
version: 0.27.1 | |
codespell: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install codespell | |
run: pip install codespell | |
- name: Use codespell | |
run: codespell --quiet-level=2 --check-hidden --skip=./.git,./CHANGELOG.md | |
generate-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: panvimdoc | |
uses: kdheepak/panvimdoc@main | |
with: | |
vimdoc: telescope-resession | |
version: "Neovim >= 0.9.0" | |
titledatepattern: "%Y" | |
demojify: true | |
treesitter: true | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "docs: auto-generate vimdoc" | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Neovim | |
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 | |
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}" | |
release: | |
runs-on: ubuntu-latest | |
needs: [stylua, selene, codespell, generate-doc, test] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: simple |