|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + tests: |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + # os: [ubuntu-latest, windows-latest] |
| 11 | + os: [ubuntu-latest] |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + - name: Install Neovim |
| 16 | + shell: bash |
| 17 | + run: | |
| 18 | + mkdir -p /tmp/nvim |
| 19 | + wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage |
| 20 | + cd /tmp/nvim |
| 21 | + chmod a+x ./nvim.appimage |
| 22 | + ./nvim.appimage --appimage-extract |
| 23 | + echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH |
| 24 | + - name: Run Tests |
| 25 | + run: | |
| 26 | + nvim --version |
| 27 | + [ ! -d tests ] && exit 0 |
| 28 | + nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}" |
| 29 | + docs: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + needs: tests |
| 32 | + if: ${{ github.ref == 'refs/heads/main' }} |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + - name: panvimdoc |
| 36 | + uses: kdheepak/panvimdoc@main |
| 37 | + with: |
| 38 | + vimdoc: harpoonline |
| 39 | + version: "Neovim >= 0.9.0" |
| 40 | + demojify: true |
| 41 | + treesitter: true |
| 42 | + - name: Push changes |
| 43 | + uses: stefanzweifel/git-auto-commit-action@v4 |
| 44 | + with: |
| 45 | + commit_message: "chore(build): auto-generate vimdoc" |
| 46 | + commit_user_name: "github-actions[bot]" |
| 47 | + commit_user_email: "github-actions[bot]@users.noreply.github.com" |
| 48 | + commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |
| 49 | + release: |
| 50 | + name: release |
| 51 | + if: ${{ github.ref == 'refs/heads/main' }} |
| 52 | + needs: |
| 53 | + - docs |
| 54 | + - tests |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: google-github-actions/release-please-action@v3 |
| 58 | + id: release |
| 59 | + with: |
| 60 | + release-type: simple |
| 61 | + package-name: harpoonline |
| 62 | + - uses: actions/checkout@v3 |
| 63 | + - name: tag stable versions |
| 64 | + if: ${{ steps.release.outputs.release_created }} |
| 65 | + run: | |
| 66 | + git config user.name github-actions[bot] |
| 67 | + git config user.email github-actions[bot]@users.noreply.github.com |
| 68 | + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" |
| 69 | + git tag -d stable || true |
| 70 | + git push origin :stable || true |
| 71 | + git tag -a stable -m "Last Stable Release" |
| 72 | + git push origin stable |
0 commit comments