-
Notifications
You must be signed in to change notification settings - Fork 171
156 lines (139 loc) · 5.52 KB
/
neovim-api.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
name: Bindings
on:
pull_request:
branches: [ master ]
paths: [ 'bindings/*']
jobs:
GenerateFromSource:
name: API_${{ matrix.version }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- version: 0
nvim: 0.1.5
- version: 1
nvim: 0.1.7
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Neovim Source
run: |
mkdir build
cd build
wget https://github.com/neovim/neovim/archive/refs/tags/v${{ matrix.nvim }}.zip
unzip v${{ matrix.nvim }}.zip
- name: Patch LuaJIT Download
env:
FILE: third-party/CMakeLists.txt
LUAJIT_URL_OLD: https://github.com/neovim/deps/raw/master/opt/LuaJIT-2.0.4.tar.gz
LUAJIT_URL_NEW: https://github.com/LuaJIT/LuaJIT/archive/refs/tags/v2.0.4.tar.gz
LUAJIT_SHA_OLD: 620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746beef1807d
LUAJIT_SHA_NEW: d2abdf16bd3556c41c0aaedad76b6c227ca667be8350111d037a4c54fd43abad
working-directory: ${{github.workspace}}/build/neovim-${{ matrix.nvim }}
run: |
sed -i 's,${{ env.LUAJIT_URL_OLD}},${{ env.LUAJIT_URL_NEW}},g' ${{ env.FILE }}
sed -i 's,${{ env.LUAJIT_SHA_OLD}},${{ env.LUAJIT_SHA_NEW}},g' ${{ env.FILE }}
- name: Patch LuaRocks Build
env:
FILE: third-party/cmake/BuildLuarocks.cmake
LUA_ROCKS_OLD: https://raw.githubusercontent.com/mpeterv/luacheck/.*/luacheck-scm-1.rockspec
LUA_ROCKS_NEW: https://raw.githubusercontent.com/mpeterv/luacheck/master/luacheck-dev-1.rockspec
working-directory: ${{github.workspace}}/build/neovim-${{ matrix.nvim }}
run: |
sed -i 's,${{ env.LUA_ROCKS_OLD}},${{ env.LUA_ROCKS_NEW}},g' ${{ env.FILE }}
- name: Install Dependencies
run: |
sudo apt-get install -y autoconf automake libtool-bin
pip install jinja2 msgpack
- name: Build Neovim
env:
CFLAGS: -Wno-implicit-fallthrough
working-directory: ${{github.workspace}}/build/neovim-${{ matrix.nvim }}
run: make
- name: Generate Bindings
env:
GEN_CMD: ${{ github.workspace }}/bindings/generate_bindings.py
NVIM_EXE: ${{ github.workspace }}/build/neovim-${{ matrix.nvim }}/build/bin/nvim
OUTPUT: ${{ github.workspace }}/src/auto
run: |
${{ env.NVIM_EXE }} --version
python ${{ env.GEN_CMD }} ${{ env.NVIM_EXE }} ${{ env.OUTPUT }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Neovim API ${{ matrix.version}} Bindings
path: |
src/auto/neovimapi${{ matrix.version }}.cpp
src/auto/neovimapi${{ matrix.version }}.h
- name: Auto-Commit
if: contains(github.event.pull_request.labels.*.name, 'auto-commit')
run: |
git add src/auto/neovimapi${{ matrix.version }}.cpp
git add src/auto/neovimapi${{ matrix.version }}.h
git config user.name github-actions
git config user.email [email protected]
git pull
git commit -m "AUTO: Neovim API ${{ matrix.version }}"
git push
GenerateFromBinary:
name: API_${{ matrix.version }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- version: 2
nvim: 0.2.0
- version: 3
nvim: 0.2.2
- version: 4
nvim: 0.3.1
- version: 5
nvim: 0.3.8
- version: 6
nvim: 0.4.4
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Neovim
env:
URL: https://github.com/neovim/neovim/releases/download/v${{ matrix.nvim }}/nvim-win64.zip
run: |
New-Item -Path ${{ github.workspace }}\build -Name "build" -ItemType "directory"
Invoke-WebRequest ${{ env.url }} -OutFile nvim-win64.zip
Expand-Archive -Path nvim-win64.zip -DestinationPath ${{ github.workspace }}\build\
- name: Install Dependencies
run:
pip install jinja2 msgpack
choco install dos2unix
- name: Generate Bindings
env:
GEN_CMD: ${{ github.workspace }}\bindings\generate_bindings.py
NVIM_EXE: ${{ github.workspace }}\build\Neovim\bin\nvim.exe
OUTPUT: ${{ github.workspace }}\src\auto
run: |
${{ env.nvim_exe }} --version
python ${{ env.gen_cmd }} ${{ env.nvim_exe }} ${{ env.output }}
dos2unix src/auto/neovimapi${{ matrix.version }}.cpp
dos2unix src/auto/neovimapi${{ matrix.version }}.h
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Neovim API ${{ matrix.version}} Bindings
path: |
src/auto/neovimapi${{ matrix.version }}.cpp
src/auto/neovimapi${{ matrix.version }}.h
# This should run under mutex, however GitHub Actions does not appear to
# have step mutex mechanism. Instead, using max-parallel: 1
- name: Auto-Commit
if: contains(github.event.pull_request.labels.*.name, 'auto-commit')
run: |
git add src/auto/neovimapi${{ matrix.version }}.cpp
git add src/auto/neovimapi${{ matrix.version }}.h
git config user.name github-actions
git config user.email [email protected]
git pull
git commit -m "AUTO: Neovim API ${{ matrix.version }}"
git push