-
Notifications
You must be signed in to change notification settings - Fork 189
160 lines (137 loc) · 4.08 KB
/
main.yml
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
name: Main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
on:
pull_request:
branches:
- '*'
push:
branches:
- main
tags:
- 'v*.*.*'
jobs:
style:
name: Style
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Style
uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: 0.15.1
args: --check .
# test_windows:
# name: Test (Windows)
# runs-on: windows-latest
# timeout-minutes: 20
# steps:
# - name: Checkout
# uses: actions/checkout@v4
checks:
name: ${{ matrix.task.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
task:
- name: Test
run: |
make test PLENARY=_runtime/plenary.nvim
- name: Lint
prepare: |
sudo luarocks install luacheck
run: |
make lint
include:
- os: ubuntu-latest
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
packages: luarocks ripgrep
manager: sudo apt-get
- os: windows-latest
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip
task:
name: Test
run: |
make test PLENARY=_runtime/plenary.nvim
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install packages
if: ${{ matrix.packages }}
run: ${{ matrix.manager }} install ${{ matrix.packages }}
- name: Install neovim (nix)
shell: bash
if: matrix.os != 'windows-latest'
run: |
# Download neovim nightly.
mkdir -p _neovim
curl -sL ${{ matrix.nvim_url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
- name: Install neovim (windows)
shell: powershell
if: matrix.os == 'windows-latest'
run: |
# Download neovim.
# winget install neovim
curl -o nvim-win64.zip ${{ matrix.nvim_url }}
Expand-Archive -F nvim-win64.zip .
Move-Item -Path nvim-win64 -Destination _neovim
- name: Install plugin dependencies
shell: bash
run: |
# Clone plenary.
mkdir -p _runtime
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim _runtime/plenary.nvim
- name: Show environment
shell: bash
run: |
ls -lh _neovim
ls -lh _runtime
- name: Prepare
if: ${{ matrix.task.prepare }}
run: ${{ matrix.task.prepare }}
- name: ${{ matrix.task.name }}
shell: bash
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
${{ matrix.task.run }}
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
needs: [checks, style]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install requirements
run: |
pip install packaging
- name: Prepare environment
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Generate release notes
run: |
python scripts/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}-RELEASE_NOTES.md
prerelease: ${{ contains(env.TAG, 'rc') }}