-
Notifications
You must be signed in to change notification settings - Fork 11
282 lines (273 loc) · 13.5 KB
/
Build.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: Build on platforms
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
jobs:
debian:
strategy:
matrix:
version: ["trixie", "sid"]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on Debian ${{ matrix.version }}
run: |
sudo apt purge -y podman
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update
sudo apt-get -y install podman
podman --version
DOCKER_BUILDKIT=1 docker build --network=host --file docker/Dockerfile.debian${{ matrix.version }} --output out .
unzip out/mesonlsp-debian-static.zip
sudo cp mesonlsp /
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-debian-${{ matrix.version }}-x86_64-unknown-linux-gnu
path: /mesonlsp
alpine:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on Alpine
run: |
sudo apt purge -y podman
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update
sudo apt-get -y install podman
podman --version
DOCKER_BUILDKIT=1 docker build --network=host --file Dockerfile --output out .
yes | unzip out/mesonlsp-alpine-static.zip
sudo cp mesonlsp /
sudo cp mesonlint /
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-x86_64-unknown-linux-musl
path: /mesonlsp
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlint-x86_64-unknown-linux-musl
path: /mesonlint
alpine-aarch64:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on Alpine
run: |
sudo apt purge -y podman
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update
sudo apt-get -y install podman qemu-user-static
podman --version
DOCKER_BUILDKIT=1 docker build --platform linux/arm64 --network=host --file Dockerfile --output out .
yes | unzip out/mesonlsp-alpine-static.zip
sudo cp mesonlsp /
sudo cp mesonlint /
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-aarch64-unknown-linux-musl
path: /mesonlsp
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlint-aarch64-unknown-linux-musl
path: /mesonlint
windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2.25.0
with:
cache: true
path-type: inherit
msystem: MINGW64
pacboy: >-
gcc:p
curl:p
libarchive:p
meson:p
ninja:p
crt:p
dlfcn:p
libunwind:p
python:p
python-pip:p
python-mingw-ldd:p
- name: Build on Windows
run: |
pip install pygls lsprotocol
meson setup _build -Doptimization=3 -Ddebug=true -Db_lto=true
ninja -C _build
sed -i "1i import sys" /d/a/_temp/msys64/mingw64/lib/python3.12/site-packages/pygls/client.py
sed -i "s/stderr=asyncio.subprocess.PIPE/stderr=sys.stderr/g" /d/a/_temp/msys64/mingw64/lib/python3.12/site-packages/pygls/client.py
ninja -C _build test || (cat _build/meson-logs/testlog.txt && exit 1)
cat _build/meson-logs/testlog.txt
_build/tests/libcxathrow/cxathrowtest.exe
strings _build/src/mesonlsp.exe|grep \\.dll$
(find /d/ | grep "libarchive-13.dll") || true
mingw-ldd.exe _build/src/mesonlsp.exe --output-format per-dep-list --dll-lookup-dirs /d/a/_temp/msys64/mingw64/bin/
mkdir -p /d/Artifacts
cp _build/src/mesonlsp.exe /d/Artifacts
cp $(mingw-ldd.exe _build/src/mesonlsp.exe --output-format per-dep-list --dll-lookup-dirs /d/a/_temp/msys64/mingw64/bin/ |& grep "=>"|sed s/.*=\>.//g|sort -u|grep -v not.found) /d/Artifacts
ls /d/Artifacts
(find /d/ | grep "mesonlsp.exe") || true
./scripts/create_license_file.sh
cp 3rdparty.txt /d/Artifacts
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-x86_64-pc-windows-gnu
path: D:/Artifacts
macos:
strategy:
matrix:
id:
[
{ version: 13, triple: "x86_64-apple-darwin" },
{ version: 14, triple: "aarch64-apple-darwin" },
]
runs-on: macos-${{ matrix.id.version }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on macOS ${{ matrix.id.version }}
run: |
brew unlink pkg-config
brew link --overwrite python@3.12 || true
brew install zip google-benchmark libarchive pkg-config pkgconf fmt zstd bzip2 libiconv expat xz lz4 zlib subversion mercurial || true
svn --version
hg --version
python3 -m pip install --break-system-packages meson ninja pygls lsprotocol
mkdir libs
sudo cp $(brew --prefix)/opt/{libarchive,zstd,zlib,expat,xz,lz4,libb2}/lib/*.a libs
ls libs
export LDFLAGS="-L$PWD/libs"
export CPPFLAGS="-I$(brew --prefix)/opt/libarchive/include -I$(brew --prefix)/opt/zstd/include -I$(brew --prefix)/opt/bzip2/include -I$(brew --prefix)/opt/expat/include -I$(brew --prefix)/opt/zlib/include -I$(brew --prefix)/opt/bzip2/include -I$(brew --prefix)/opt/expat/include -I$(brew --prefix)/opt/zlib/include"
export PKG_CONFIG_PATH="$(brew --prefix)/opt/zstd/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig:$(brew --prefix)/opt/expat/lib/pkgconfig:$(brew --prefix)/opt/zlib/lib/pkgconfig:$(brew --prefix)/opt/expat/lib/pkgconfig:$(brew --prefix)/opt/zlib/lib/pkgconfig"
sudo rm $(brew --prefix)/opt/{libarchive,zstd,zlib,expat,xz,lz4,libb2}/lib/*.dylib || sudo rm /opt/homebrew/opt/{libarchive,zstd,zlib,expat,xz,lz4,libb2}/lib/*.dylib
brew link --overwrite pkg-config
export PATH="/opt/homebrew/opt/libarchive/bin:$PATH"
meson setup _build -Doptimization=3 -Ddebug=true -Db_lto=true --default-library=static --prefer-static
ninja -C _build
for i in {0..10}; do ninja -C _build test; done
otool -L _build/src/mesonlsp
cp _build/src/mesonlsp ${{ github.workspace }}/mesonlsp
_build/tests/libcxathrow/cxathrowtest
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-${{ matrix.id.triple }}
path: ${{ github.workspace }}/mesonlsp
sanitizers:
strategy:
matrix:
buildtype: [debug, plain, release]
sanitizer: ["address", "undefined", "leak", "address,undefined"]
runs-on: ubuntu-latest
container:
image: fedora:39
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on Fedora 39
run: |
sudo dnf install libasan* libhwasan* liblsan* libtsan* libubsan* zip ninja-build gcc g++ git pip libcurl-devel google-benchmark-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config mercurial subversion -y
pip install meson pygls lsprotocol
sudo dnf clean all
meson setup _clang --buildtype ${{ matrix.buildtype }} -Db_sanitize=${{ matrix.sanitizer }}
cd _clang
ninja
meson test "mesonlsp:" || cat /__w/mesonlsp/mesonlsp/_clang/meson-logs/testlog.txt
cd ..
./_clang/src/mesonlsp --full
./_clang/src/lint/mesonlint --fix
./scripts/run_regression_tests.sh
for i in $(find __regressions|grep meson.build$|shuf|head -n 90); do echo $i; ./_clang/src/libparsing/lexingtool $i 2>/dev/null || ./_clang/src/libparsing/lexingtool $i; done
for i in $(find __regressions|grep meson.build$|shuf|head -n 90); do echo $i; ./_clang/src/libparsing/parsingtool $i 2>/dev/null || ./_clang/src/libparsing/parsingtool $i; done
fedora_in_container:
strategy:
matrix:
version: [39, 40]
fail-fast: false
runs-on: ubuntu-latest
container:
image: fedora:${{ matrix.version }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on Fedora ${{ matrix.version }}
run: |
sudo dnf install zip ninja-build gcc g++ git pip libcurl-devel google-benchmark-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config mercurial subversion -y
pip install meson pygls lsprotocol
sudo dnf clean all
./scripts/ci_create_zip.sh Fedora${{ matrix.version }} -j$(nproc)
unzip -o /Fedora${{ matrix.version }}.zip
sudo cp mesonlsp /
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-fedora-${{ matrix.version }}
path: /mesonlsp
fedora_in_container_clang:
strategy:
matrix:
version: [39, 40]
fail-fast: false
runs-on: ubuntu-latest
container:
image: fedora:${{ matrix.version }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Build on Fedora ${{ matrix.version }}
run: |
sudo dnf install zip ninja-build clang gcc g++ git pip libcurl-devel google-benchmark-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config mercurial subversion -y
pip install meson pygls lsprotocol
sudo dnf clean all
export CC=clang
export CXX=clang++
./scripts/ci_create_zip.sh Fedora${{ matrix.version }}-clang -j1
unzip -o /Fedora${{ matrix.version }}-clang.zip
sudo cp mesonlsp /
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: mesonlsp-fedora-${{ matrix.version }}-clang
path: /mesonlsp