File: ci.yml

package info (click to toggle)
neovim-toggleterm 2.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: makefile: 2
file content (98 lines) | stat: -rw-r--r-- 3,131 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
  push:
  pull_request:


jobs:
  tests:
    strategy:
      matrix:
        os: [ ubuntu-latest ]
    runs-on: ${{ matrix.os }}
    permissions:
      # Give the default GITHUB_TOKEN write permission to commit and push the
      # added or changed files to the repository.
      contents: write

    steps:
      - uses: actions/checkout@v3
      - 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/minimal_init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal_init.lua', sequential = true}"

  stylua:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
      - uses: JohnnyMorganz/stylua-action@v2
        with:
          version: latest
          token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
          args: --config-path=stylua.toml lua/

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "style(format): run stylua"
          branch: ${{ github.head_ref }}

      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}

  docs:
    runs-on: ubuntu-latest
    if: ${{ github.ref == 'refs/heads/main' }}
    steps:
      - uses: actions/checkout@v3
      - name: panvimdoc
        uses: kdheepak/panvimdoc@main
        with:
          vimdoc: toggleterm
          version: "Neovim >= 0.8.0"
          demojify: true
          treesitter: true
      - name: Push changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
          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:
      - uses: google-github-actions/release-please-action@v3
        id: release
        with:
          release-type: simple
          package-name: toggleterm.nvim
      - uses: actions/checkout@v3
      - 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"