-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (140 loc) · 4.51 KB
/
main.yml
File metadata and controls
168 lines (140 loc) · 4.51 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: main
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]
env:
LUA_LS_VERSION: 3.7.4
concurrency:
group: github.head_ref
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
name: lint
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check . -g '*.lua' -g '!deps/'
documentation:
runs-on: ubuntu-latest
name: documentation
permissions:
# Required by release-please-action
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: setup neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: stable
- name: generate documentation
uses: kdheepak/panvimdoc@main
with:
vimdoc: copy-python-path
pandoc: README.md
version: Neovim >= 0.8.0
demojify: true
- name: generate tags
run: |
nvim --headless -c 'helptags doc' -c 'quit'
- name: push changes
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "docs(vimdoc): auto-generate vimdocs"
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>"
tests:
needs:
- lint
- documentation
runs-on: ubuntu-latest
timeout-minutes: 1
strategy:
matrix:
neovim_version: ["v0.8.0", "v0.9.5", "v0.10.4", "v0.11.0"]
steps:
- uses: actions/checkout@v4
- run: date +%F > todays-date
- name: restore luals cache
uses: actions/cache@v4
id: cache
with:
path: .ci/lua-ls
key: ${{ env.LUA_LS_VERSION }}
- name: setup luals
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: mkdir -p .ci/lua-ls && curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/${{ env.LUA_LS_VERSION }}/lua-language-server-${{ env.LUA_LS_VERSION }}-linux-x64.tar.gz" | tar xzf - -C "${PWD}/.ci/lua-ls"
- name: setup neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim_version }}
- name: run luals
run: |
export PATH="${PWD}/.ci/lua-ls/bin:${PATH}"
nvim --version
make luals-ci
- name: run tests
run: make test-ci
tests-nightly:
needs:
- lint
- documentation
runs-on: ubuntu-latest
timeout-minutes: 1
continue-on-error: true
steps:
- uses: actions/checkout@v4
- run: date +%F > todays-date
- name: restore cache for today's nightly.
uses: actions/cache@v4
with:
path: _neovim
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}
- name: restore luals cache
uses: actions/cache@v4
id: cache
with:
path: .ci/lua-ls
key: ${{ env.LUA_LS_VERSION }}
- name: setup luals
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: mkdir -p .ci/lua-ls && curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/${{ env.LUA_LS_VERSION }}/lua-language-server-${{ env.LUA_LS_VERSION }}-linux-x64.tar.gz" | tar xzf - -C "${PWD}/.ci/lua-ls"
- name: setup neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- name: run luals
run: |
export PATH="${PWD}/.ci/lua-ls/bin:${PATH}"
nvim --version
make luals-ci
- name: run tests
run: make test-ci
release:
name: release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- tests
runs-on: ubuntu-latest
steps:
# https://github.com/googleapis/release-please-action/blob/main/README.md
# Requires personal access token:
# 1. Create token: https://github.com/nvim-neorocks/sample-luarocks-plugin?tab=readme-ov-file#generating-a-pat-personal-access-token
# 2. Go to repository Settings -> Secrets and vairables -> Actions
# 3. Create new repository secret called `RELEASE_PLEASE_TOKEN` and paste in the token value
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-type: simple