Merge pull request #14 from PunGrumpy/release-please--branches--main-… #31
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: 🔎 Continuous Integration | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: 🥼 Tests | |
continue-on-error: true | |
strategy: | |
matrix: | |
# os: [ubuntu-latest, windows-latest, macos-latest] | |
os: [ubuntu-latest] | |
neovim-version: [stable, nightly] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: 🔔 Checkout | |
uses: actions/checkout@v4 | |
- name: 📦 Install NeoVim | |
shell: bash | |
run: | | |
mkdir -p /tmp/nvim | |
wget -q https://github.com/neovim/neovim/releases/download/${{ matrix.neovim-version }}/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: 🧪 Test | |
run: | | |
nvim --version | |
if [ ! -d tests ]; then | |
echo "⚠️ No tests found, skipping tests." | |
exit 0 | |
fi | |
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}" | |
docs: | |
name: 📖 Documentation | |
runs-on: ubuntu-latest | |
needs: tests | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- name: 🔔 Checkout | |
uses: actions/checkout@v4 | |
- name: 😺 Git pull | |
run: git pull | |
- name: 🐴 Panvimdoc | |
uses: kdheepak/panvimdoc@main | |
with: | |
vimdoc: dullahan.nvim | |
version: 'Neovim >= 0.8.0' | |
demojify: true | |
treesitter: true | |
- 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: | |
- name: 🔥 Automated releases | |
uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: simple | |
package-name: dullahan.nvim | |
- name: 🔔 Checkout | |
uses: actions/checkout@v4 | |
- name: 🏷️ Tag stable versions | |
if: ${{ steps.release.outputs.release_created }} | |
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 | |
handler: | |
name: 👋 Handler | |
needs: | |
- release | |
if: failure() | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🔔 Checkout | |
uses: actions/checkout@v4 | |
- name: 📮 Send issue | |
uses: JasonEtco/create-an-issue@v2 | |
id: send_issue | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NOTES: ${{ job.status }} | |
JOB: ${{ github.job }} | |
BUILD: ${{ github.run_number }} | |
COMMIT: ${{ github.sha }} | |
STATUS: ${{ job.status }} | |
with: | |
filename: .github/ISSUE_TEMPLATE/failure_report.md | |
assignees: github-actions[bot], ${{ github.actor }} | |
update_existing: true | |
- name: 📤 Output | |
run: | | |
echo "🐞 Issue created at ${{ steps.send_issue.outputs.url }}" | |
echo "🔢 Issue number is ${{ steps.send_issue.outputs.number }}" |