blob: 32e368dc1d084b8d3a936f36c3967597d4cdb056 [file] [log] [blame]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +01001name: GitHub CI
2
Bram Moolenaarb5b77372020-12-18 13:31:31 +01003on:
4 push:
5 branches: ['**']
6 pull_request:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +01007
Yegappan Lakshmanan7f4a6282021-12-25 11:20:30 +00008# Cancels all previous workflow runs for pull requests that have not completed.
9concurrency:
10 # The concurrency group contains the workflow name and the branch name for
11 # pull requests or the commit hash for any other events.
12 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
13 cancel-in-progress: true
14
Alex311df6b2022-09-26 15:52:46 +010015permissions:
16 contents: read # to fetch code (actions/checkout)
17
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010018jobs:
19 linux:
Drew Vogelf0ed0e62025-02-11 21:36:33 +010020 runs-on: ${{ matrix.architecture == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010021
22 env:
23 CC: ${{ matrix.compiler }}
Philip H.13960a82025-04-18 18:48:53 +020024 GCC_VER: 14
Philip H.ccf27312025-03-09 16:03:47 +010025 CLANG_VER: 20
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010026 TEST: test
27 SRCDIR: ./src
28 LEAK_CFLAGS: -DEXITFREE
29 LOG_DIR: ${{ github.workspace }}/logs
30 TERM: xterm
31 DISPLAY: ':99'
Bram Moolenaar9aff9702020-12-21 13:37:28 +010032 DEBIAN_FRONTEND: noninteractive
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010033
34 strategy:
35 fail-fast: false
36 matrix:
Naruhiko Nishinob7af5a02022-10-09 13:28:36 +010037 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010038 compiler: [clang, gcc]
ichizok3e1e63d2023-08-29 22:16:34 +020039 extra: [[]]
James McCoya4245a12023-09-05 07:41:23 +020040 # Only use non-native architecture when features != huge.
41 # features=huge tries to install python3-dev, which fails to install
42 # for the non-native architecture.
43 architecture: [native]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010044 include:
45 - features: tiny
46 compiler: clang
ichizok3e1e63d2023-08-29 22:16:34 +020047 extra: [nogui]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010048 - features: tiny
49 compiler: gcc
ichizok3e1e63d2023-08-29 22:16:34 +020050 extra: [nogui]
rhysd87f65f32025-01-18 17:32:11 +010051 - features: tiny
52 compiler: gcc
53 extra: [nogui]
54 architecture: arm64
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010055 - features: normal
56 shadow: ./src/shadow
James McCoya4245a12023-09-05 07:41:23 +020057 compiler: gcc
58 architecture: i386
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010059 - features: huge
60 coverage: true
61 - features: huge
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +020062 compiler: clang
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +020063 interface: dynamic
64 python3: stable-abi
65 - features: huge
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010066 compiler: gcc
67 coverage: true
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +020068 interface: dynamic
ichizok3e1e63d2023-08-29 22:16:34 +020069 extra: [uchar, testgui]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010070 - features: huge
71 compiler: clang
Christian Brabandt6efb1982023-08-10 05:44:25 +020072 # Lua5.1 is the most widely used version (since it's what LuaJIT is
73 # compatible with), so ensure it works
ichizok3e1e63d2023-08-29 22:16:34 +020074 lua_ver: '5.1'
75 extra: [asan]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010076 - features: huge
77 compiler: gcc
78 coverage: true
ichizok3e1e63d2023-08-29 22:16:34 +020079 extra: [unittests]
rhysd87f65f32025-01-18 17:32:11 +010080 - features: huge
81 compiler: gcc
82 coverage: true
83 extra: [unittests]
84 architecture: arm64
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010085 - features: normal
86 compiler: gcc
ichizok3e1e63d2023-08-29 22:16:34 +020087 extra: [vimtags]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010088
89 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +010090 - name: Checkout repository from github
dependabot[bot]213c3232023-09-11 19:43:33 +020091 uses: actions/checkout@v4
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010092
Peter Simonyi9cc95aa2023-12-01 12:07:42 -050093 - name: Check Filelist (for packaging)
94 run: |
95 # If any files in the repository are not listed in Filelist this will
96 # exit with an error code and list the missing entries.
97 make -f ci/unlisted.make
98
Christ van Willegen6a159422025-02-21 20:23:26 +010099 - name: Check hlgroups (are any new hlgroups added, but not handled in highlight.c)
100 run: |
101 # If any highlight groups have been documented, but not handled in
102 # highlight.c, nor listed as 'intentionally left out' in hlgroups.ignore,
103 # exit with an error code and list the missing entries.
104 make -C ci -f hlgroups.make
105
James McCoya4245a12023-09-05 07:41:23 +0200106 - run: sudo dpkg --add-architecture i386
107 if: matrix.architecture == 'i386'
108
Philip H0a3d3692024-01-31 20:04:22 +0100109 - name: Uninstall snap
110 run: |
111 sudo bash ci/remove_snap.sh
112
Drew Vogelea67ba72025-05-07 22:05:17 +0200113 - name: Enable debug packages
114 run: |
115 # Some of the ASAN suppressions are in libraries linked with dlopen
116 # and symbolization of them requires these debug packages.
117 sudo apt install ubuntu-dbgsym-keyring
118 sudo cp ci/ddebs.list /etc/apt/sources.list.d/ddebs.list
119 sudo cp ci/pinned-pkgs /etc/apt/preferences.d/pinned-pkgs
120
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100121 - name: Install packages
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100122 run: |
Philip H04e89432024-04-24 19:55:11 +0200123 # This is added by default, and it is often broken, but we don't need anything from it
124 sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
ichizok10504762022-01-15 13:37:14 +0000125 PKGS=( \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100126 gettext \
Foxe Chenb90c2392025-06-27 21:10:35 +0200127 x11-utils \
128 labwc \
129 wl-clipboard \
130 wayland-utils \
Drew Vogelea67ba72025-05-07 22:05:17 +0200131 libgtk-3-dev:${{ matrix.architecture }} \
132 libgtk-3-bin:${{ matrix.architecture }} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100133 desktop-file-utils \
Drew Vogelea67ba72025-05-07 22:05:17 +0200134 libc6-dbgsym:${{ matrix.architecture }} \
Christian Brabandtf573c6e2021-06-20 14:02:16 +0200135 libtool-bin \
James McCoya4245a12023-09-05 07:41:23 +0200136 libncurses-dev:${{ matrix.architecture }} \
137 libxt-dev:${{ matrix.architecture }} \
Drew Vogelea67ba72025-05-07 22:05:17 +0200138 libegl-mesa0:${{ matrix.architecture }} \
139 libegl1:${{ matrix.architecture }} \
140 libegl1-mesa-dev:${{ matrix.architecture }} \
141 libepoxy-dev:${{ matrix.architecture }} \
142 libwayland-egl1:${{ matrix.architecture }} \
143 libwayland-client0:${{ matrix.architecture }} \
144 libwayland-cursor0:${{ matrix.architecture }} \
James McCoy4e527a22024-08-31 17:13:10 +0200145 locales-all \
Drew Vogelf0ed0e62025-02-11 21:36:33 +0100146 software-properties-common \
ichizok10504762022-01-15 13:37:14 +0000147 )
Drew Vogelea67ba72025-05-07 22:05:17 +0200148 if ${{ contains(matrix.extra, 'asan') }} && ${{ contains(matrix.architecture, 'native') }}; then
149 PKGS+=( \
150 libepoxy0-dbgsym:${{ matrix.architecture }} \
151 libxdamage1-dbgsym:${{ matrix.architecture }} \
152 libxcb1-dbgsym:${{ matrix.architecture }} \
153 libgtk-3-bin-dbgsym:${{ matrix.architecture }} \
154 libgtk-3-0t64-dbgsym:${{ matrix.architecture }} \
155 libglib2.0-0t64-dbgsym:${{ matrix.architecture }} \
156 libglib2.0-bin-dbgsym:${{ matrix.architecture }} \
157 libglib2.0-dev-bin-dbgsym:${{ matrix.architecture }} \
158 )
159 fi
ichizok10504762022-01-15 13:37:14 +0000160 if ${{ matrix.features == 'huge' }}; then
ichizok3e1e63d2023-08-29 22:16:34 +0200161 LUA_VER=${{ matrix.lua_ver || '5.4' }}
ichizok10504762022-01-15 13:37:14 +0000162 PKGS+=( \
163 autoconf \
Yegappan Lakshmanan58f39d82023-08-27 11:14:44 +0200164 gdb \
ichizok10504762022-01-15 13:37:14 +0000165 lcov \
166 libcanberra-dev \
167 libperl-dev \
ichizok10504762022-01-15 13:37:14 +0000168 python3-dev \
ichizok3e1e63d2023-08-29 22:16:34 +0200169 liblua${LUA_VER}-dev \
170 lua${LUA_VER} \
ichizok10504762022-01-15 13:37:14 +0000171 ruby-dev \
172 tcl-dev \
173 cscope \
174 libsodium-dev \
Christian Brabandte085dfd2023-09-30 12:49:18 +0200175 attr \
176 libattr1-dev
ichizok10504762022-01-15 13:37:14 +0000177 )
178 fi
Drew Vogelea67ba72025-05-07 22:05:17 +0200179 sudo apt-get update && sudo apt-get upgrade -y --allow-downgrades && sudo apt-get install -y --allow-downgrades "${PKGS[@]}"
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100180
Philip H9be736f2023-04-21 19:51:22 +0100181 - name: Install gcc-${{ env.GCC_VER }}
Philip Hd2edee52022-04-16 20:04:30 +0100182 if: matrix.compiler == 'gcc'
183 run: |
Philip H4b9fc822024-04-26 18:45:41 +0200184 # ubuntu-toolchain-r/test PPA for gcc-13 compiler
Philip H.13960a82025-04-18 18:48:53 +0200185 # disabled because the installation failed, causing test failures
186 # sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
Philip H4b9fc822024-04-26 18:45:41 +0200187 sudo apt-get update -y
James McCoya4245a12023-09-05 07:41:23 +0200188 sudo apt-get install -y gcc-${{ env.GCC_VER }}:${{ matrix.architecture }}
Philip H7268e532023-05-16 20:11:02 +0100189 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_VER }} 100
190 sudo update-alternatives --set gcc /usr/bin/gcc-${{ env.GCC_VER }}
Philip Hd2edee52022-04-16 20:04:30 +0100191
Philip H9be736f2023-04-21 19:51:22 +0100192 - name: Install clang-${{ env.CLANG_VER }}
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100193 if: matrix.compiler == 'clang'
194 run: |
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100195 . /etc/lsb-release
Philip H.9955c122025-05-10 14:23:36 +0200196 curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
197 echo "Types: deb
198 URIs: https://apt.llvm.org/${DISTRIB_CODENAME}/
199 Suites: llvm-toolchain-${DISTRIB_CODENAME}-${{ env.CLANG_VER }}
200 Components: main
201 Signed-By: /usr/share/keyrings/llvm-archive-keyring.gpg" | sudo tee /etc/apt/sources.list.d/llvm-toolchain.sources > /dev/null
202 sudo apt-get update -y
Philip H9be736f2023-04-21 19:51:22 +0100203 sudo apt-get install -y clang-${{ env.CLANG_VER }} llvm-${{ env.CLANG_VER }}
204 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.CLANG_VER }} 100
205 sudo update-alternatives --set clang /usr/bin/clang-${{ env.CLANG_VER }}
206 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${{ env.CLANG_VER }} 100
207 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-${{ env.CLANG_VER }} 100
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100208
209 - name: Set up environment
210 run: |
211 mkdir -p "${LOG_DIR}"
212 mkdir -p "${HOME}/bin"
213 echo "${HOME}/bin" >> $GITHUB_PATH
214 (
215 echo "LINUX_VERSION=$(uname -r)"
216 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
Drew Vogelf0ed0e62025-02-11 21:36:33 +0100217 echo "TMPDIR=$(mktemp -d -p /tmp)"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100218
219 case "${{ matrix.features }}" in
Naruhiko Nishinob7af5a02022-10-09 13:28:36 +0100220 tiny)
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100221 echo "TEST=testtiny"
222 if ${{ contains(matrix.extra, 'nogui') }}; then
223 echo "CONFOPT=--disable-gui"
224 fi
225 ;;
226 normal)
227 ;;
228 huge)
Christian Brabandt203c7222024-10-29 20:21:42 +0100229 echo "TEST=scripttests test_libvterm indenttest syntaxtest"
ichizok3e1e63d2023-08-29 22:16:34 +0200230 INTERFACE=${{ matrix.interface || 'yes' }}
231 if ${{ matrix.python3 == 'stable-abi' }}; then
232 PYTHON3_CONFOPT="--with-python3-stable-abi=3.8"
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +0200233 fi
Drew Vogelf0ed0e62025-02-11 21:36:33 +0100234 # The ubuntu-24.04 CI runner does not provide a python2 package.
235 echo "CONFOPT=--enable-perlinterp=${INTERFACE} --enable-pythoninterp=no --enable-python3interp=${INTERFACE} --enable-rubyinterp=${INTERFACE} --enable-luainterp=${INTERFACE} --enable-tclinterp=${INTERFACE} ${PYTHON3_CONFOPT}"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100236 ;;
237 esac
238
239 if ${{ matrix.coverage == true }}; then
ichizok3e1e63d2023-08-29 22:16:34 +0200240 CFLAGS="${CFLAGS} --coverage -DUSE_GCOV_FLUSH"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100241 echo "LDFLAGS=--coverage"
242 fi
ichizok3e1e63d2023-08-29 22:16:34 +0200243 if ${{ contains(matrix.extra, 'uchar') }}; then
244 CFLAGS="${CFLAGS} -funsigned-char"
James McCoy2e258bd2021-10-05 19:44:04 +0100245 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100246 if ${{ contains(matrix.extra, 'testgui') }}; then
247 echo "TEST=-C src testgui"
248 fi
249 if ${{ contains(matrix.extra, 'unittests') }}; then
250 echo "TEST=unittests"
251 fi
252 if ${{ contains(matrix.extra, 'asan') }}; then
Christian Brabandtce35ee82024-10-27 21:15:50 +0100253 echo "SANITIZER_CFLAGS=-g -O0 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
254 echo "ASAN_OPTIONS=print_stacktrace=1:log_path=${LOG_DIR}/asan"
255 echo "UBSAN_OPTIONS=print_stacktrace=1:log_path=${LOG_DIR}/ubsan"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100256 echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
257 fi
258 if ${{ contains(matrix.extra, 'vimtags') }}; then
259 echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
260 fi
ichizok3e1e63d2023-08-29 22:16:34 +0200261 echo "CFLAGS=${CFLAGS}"
Drew Vogelea67ba72025-05-07 22:05:17 +0200262 # Disables GTK attempt to integrate with the accessibility service that does run in CI.
263 echo "NO_AT_BRIDGE=1"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100264 ) >> $GITHUB_ENV
265
266 - name: Set up system
267 run: |
268 if [[ ${CC} = clang ]]; then
269 # Use llvm-cov instead of gcov when compiler is clang.
270 ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov
271 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100272 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
273 sudo usermod -a -G audio "${USER}"
274 sudo bash ci/setup-xvfb.sh
275
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100276 - name: Check autoconf
277 if: contains(matrix.extra, 'unittests')
278 run: |
279 make -C src autoconf
280
281 - name: Set up shadow dir
282 if: matrix.shadow
283 run: |
284 make -C src shadow
285 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
286 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
287
288 - name: Configure
289 run: |
290 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
291 # Append various warning flags to CFLAGS.
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100292 sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
293 sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000294 if [[ ${CC} = clang ]]; then
295 # Suppress some warnings produced by clang 12 and later.
296 sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
297 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100298
299 - name: Build
300 if: (!contains(matrix.extra, 'unittests'))
301 run: |
302 make ${SHADOWOPT} -j${NPROC}
303
304 - name: Check version
305 if: (!contains(matrix.extra, 'unittests'))
306 run: |
307 "${SRCDIR}"/vim --version
308 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
309 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
Yee Cheng Chinbb8e5dd2025-03-30 14:48:29 +0200310 if ${{ matrix.features == 'huge' }}; then
311 # Also check that optional and dynamic features are configured and working
312 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 \
313 -c "let g:required=['gettext', 'sodium', 'sound', 'perl', 'python3', 'lua', 'ruby', 'tcl']" \
314 -S ci/if_feat_check.vim -c quit
315 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100316
317 - name: Test
rhysd87f65f32025-01-18 17:32:11 +0100318 timeout-minutes: 25
319 run: |
320 make ${SHADOWOPT} ${TEST}
321
Christian Brabandt1c074682025-06-29 17:57:32 +0200322 # Enable to debug failing tests live and ssh into the CI runners
323 # - name: Setup tmate session
324 # if: ${{ failure() }}
325 # uses: mxschmitt/action-tmate@v3
326 # with:
327 # limit-access-to-actor: true
328
Christian Brabandt8314de82024-05-15 21:48:11 +0200329 - if: ${{ !cancelled() }}
Aliaksei Budaveif1d83c42024-11-02 15:51:14 +0100330 uses: ./.github/actions/test_artifacts
Christian Brabandt8314de82024-05-15 21:48:11 +0200331
Yee Cheng Chin8b202032023-09-02 16:03:04 +0200332 - name: Vim tags
333 if: contains(matrix.extra, 'vimtags')
334 run: |
335 # This will exit with an error code if the generated vim tags differs from source.
Christian Brabandt8102a4c2024-01-14 18:24:05 +0000336 (
337 cd runtime/doc
338 git diff --exit-code -- tags
339 make html; rm *.html tags.ref;
340 test -f errors.log && exit 3;
Christian Brabandt9c581912024-01-15 22:38:48 +0100341 true
Christian Brabandt8102a4c2024-01-14 18:24:05 +0000342 )
Yee Cheng Chin8b202032023-09-02 16:03:04 +0200343
ichizok0d47ad42022-01-11 13:05:26 +0000344 - name: Generate gcov files
ichizok41ee5b12022-02-12 10:13:13 +0000345 if: matrix.coverage
Bram Moolenaare5492602020-12-22 19:05:33 +0100346 run: |
347 cd "${SRCDIR}"
ichizok0d47ad42022-01-11 13:05:26 +0000348 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
349
350 - name: Codecov
Philip H982ded62023-06-22 18:12:46 +0100351 timeout-minutes: 20
ichizok41ee5b12022-02-12 10:13:13 +0000352 if: matrix.coverage
dependabot[bot]ba9e1572024-11-18 19:05:53 +0100353 uses: codecov/codecov-action@v5
ichizok0d47ad42022-01-11 13:05:26 +0000354 with:
rhysd9a65a8c2024-11-19 13:46:17 +0100355 flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ join(matrix.extra, '-') }}
K.Takatabd2f45a2024-02-10 02:18:11 +0900356 token: ${{ secrets.CODECOV_TOKEN }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100357
358 - name: ASan logs
359 if: contains(matrix.extra, 'asan') && !cancelled()
360 run: |
ichizok41ee5b12022-02-12 10:13:13 +0000361 for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
Christian Brabandtce35ee82024-10-27 21:15:50 +0100362 echo "$f"
ichizok0d47ad42022-01-11 13:05:26 +0000363 asan_symbolize -l "$f"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100364 false # in order to fail a job
365 done
366
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100367 macos:
rhysde93d5ca2024-02-01 21:22:14 +0100368 runs-on: ${{ matrix.runner }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100369
370 env:
ichizok48c01962021-12-11 17:34:19 +0000371 CC: clang
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100372 TEST: test
373 SRCDIR: ./src
374 LEAK_CFLAGS: -DEXITFREE
375 TERM: xterm
376
377 strategy:
378 fail-fast: false
379 matrix:
ichizok48c01962021-12-11 17:34:19 +0000380 features: [tiny, normal, huge]
Yee Cheng Chin38281e12024-12-17 20:36:10 +0100381 runner: [macos-13, macos-15]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100382
383 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +0100384 - name: Checkout repository from github
dependabot[bot]213c3232023-09-11 19:43:33 +0200385 uses: actions/checkout@v4
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100386
Yee Cheng Chin49f2ba62024-02-14 20:34:58 +0100387 - name: Install packages
388 if: matrix.features == 'huge'
rhysde93d5ca2024-02-01 21:22:14 +0100389 run: |
390 brew install lua libtool
Yee Cheng Chin49f2ba62024-02-14 20:34:58 +0100391 echo "LUA_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
392
Yee Cheng Chin38281e12024-12-17 20:36:10 +0100393 - name: Set up Xcode
394 if: matrix.runner == 'macos-15'
Yee Cheng Chin49f2ba62024-02-14 20:34:58 +0100395 run: |
Yee Cheng Chin38281e12024-12-17 20:36:10 +0100396 # Xcode 16 has compiler bugs which are fixed in 16.2+
Philip H.2897a8d2025-06-07 17:45:21 +0200397 sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
rhysde93d5ca2024-02-01 21:22:14 +0100398
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100399 - name: Set up environment
400 run: |
401 (
402 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
403 case "${{ matrix.features }}" in
404 tiny)
405 echo "TEST=testtiny"
406 echo "CONFOPT=--disable-gui"
407 ;;
ichizok48c01962021-12-11 17:34:19 +0000408 normal)
409 ;;
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100410 huge)
Philip Hd094e582022-10-16 14:53:34 +0100411 echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100412 ;;
413 esac
414 ) >> $GITHUB_ENV
415
416 - name: Configure
417 run: |
418 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
419 # Append various warning flags to CFLAGS.
420 # BSD sed needs backup extension specified.
421 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
422 # On macOS, the entity of gcc is clang.
423 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000424 # Suppress some warnings produced by clang 12 and later.
425 if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then
426 sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
427 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100428
429 - name: Build
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100430 env:
Bram Moolenaared1e4c92020-12-28 15:46:47 +0100431 LC_ALL: C
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100432 run: |
433 make -j${NPROC}
434
435 - name: Check version
436 run: |
437 "${SRCDIR}"/vim --version
438 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
439 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
Yee Cheng Chinbb8e5dd2025-03-30 14:48:29 +0200440 if ${{ matrix.features == 'huge' }}; then
441 # Also check that optional and dynamic features are configured and working
442 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 \
443 -c "let g:required=['sound', 'perl', 'python3', 'lua', 'ruby', 'tcl']" \
444 -S ci/if_feat_check.vim -c quit
445 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100446
Linda_pp72a1f452024-02-20 04:55:55 +0900447 - name: Install packages for testing
448 run: |
449 # Apple diff is broken. Use GNU diff instead. See #14032.
450 brew install diffutils
451
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100452 - name: Test
Millybaab7c02024-10-28 21:56:14 +0100453 timeout-minutes: 25
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100454 run: |
455 make ${TEST}
456
Christian Brabandt8314de82024-05-15 21:48:11 +0200457 - if: ${{ !cancelled() }}
Aliaksei Budaveif1d83c42024-11-02 15:51:14 +0100458 uses: ./.github/actions/test_artifacts
Christian Brabandt8314de82024-05-15 21:48:11 +0200459
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100460 windows:
Philip H361f9d22022-06-14 11:35:21 +0100461 runs-on: windows-2022
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100462
463 env:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100464 # Interfaces
465 # Lua
466 LUA_VER: 54
467 LUA_VER_DOT: '5.4'
Philip H18f75932022-02-12 10:53:07 +0000468 LUA_RELEASE: 5.4.2
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100469 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
470 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
471 LUA_DIR: D:\Lua
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100472 # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
473 LUA_DIR_SLASH: D:/Lua
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100474 # Python 2
475 PYTHON_VER: 27
476 PYTHON_VER_DOT: '2.7'
Philip H361f9d22022-06-14 11:35:21 +0100477 PYTHON_DIR: 'C:\Python27'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100478 # Python 3
Philip H.cbc1f402025-02-02 09:07:36 +0100479 PYTHON3_VER: 313
480 PYTHON3_VER_DOT: '3.13'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100481 # Other dependencies
482 # winpty
483 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
ichizok2f147162023-04-26 15:43:39 +0100484 # libsodium
Philip H.fef4be02025-01-18 17:20:13 +0100485 SODIUM_VER: '1.0.20'
Restorerfbeea682024-04-22 18:48:43 +0000486 # SODIUM_MSVC_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-msvc.zip
487 SODIUM_MSVC_URL: https://github.com/jedisct1/libsodium/releases/download/%SODIUM_VER%-RELEASE/libsodium-%SODIUM_VER%-msvc.zip
ichizok2f147162023-04-26 15:43:39 +0100488 SODIUM_MSVC_VER: v143
Restorerfbeea682024-04-22 18:48:43 +0000489 # SODIUM_MINGW_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-mingw.tar.gz
490 SODIUM_MINGW_URL: https://github.com/jedisct1/libsodium/releases/download/%SODIUM_VER%-RELEASE/libsodium-%SODIUM_VER%-mingw.tar.gz
Restorer8e37daf2024-03-22 18:34:52 +0000491 SODIUM_MINGW_VER: 26
RestorerZ96509102024-07-11 21:14:15 +0200492 # Gettext-tools, iconv and libraries
493 GETTEXT32_URL: https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-32.zip
494 GETTEXT64_URL: https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100495 # Escape sequences
496 COL_RED: "\x1b[31m"
497 COL_GREEN: "\x1b[32m"
498 COL_YELLOW: "\x1b[33m"
499 COL_RESET: "\x1b[m"
500
501 strategy:
502 fail-fast: false
503 matrix:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100504 include:
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +0200505 - { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: no, arch: x64, python3: stable }
506 - { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: yes, arch: x86, python3: stable, coverage: yes }
K.Takata2da11a42022-09-10 13:03:12 +0100507 - { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: yes, arch: x86 }
508 - { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: no, arch: x64, coverage: yes }
509 - { features: NORMAL, toolchain: msvc, VIMDLL: yes, GUI: no, arch: x86 }
510 - { features: NORMAL, toolchain: mingw, VIMDLL: no, GUI: yes, arch: x64 }
511 - { features: TINY, toolchain: msvc, VIMDLL: yes, GUI: yes, arch: x64 }
512 - { features: TINY, toolchain: mingw, VIMDLL: no, GUI: no, arch: x86 }
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100513
514 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200515 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100516 id: init
517 shell: bash
518 run: |
K.Takata80613d62022-11-09 16:12:47 +0000519 # Show Windows version
520 cmd /c ver
521
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100522 git config --global core.autocrlf input
K.Takata2da11a42022-09-10 13:03:12 +0100523
ichizok2f147162023-04-26 15:43:39 +0100524 if ${{ matrix.arch == 'x64' }}; then
K.Takata2da11a42022-09-10 13:03:12 +0100525 cygreg=registry
526 pyreg=
527 echo "VCARCH=amd64" >> $GITHUB_ENV
528 echo "WARCH=x64" >> $GITHUB_ENV
529 echo "BITS=64" >> $GITHUB_ENV
530 echo "MSYSTEM=MINGW64" >> $GITHUB_ENV
Philip H361f9d22022-06-14 11:35:21 +0100531 else
K.Takata2da11a42022-09-10 13:03:12 +0100532 cygreg=registry32
533 pyreg=-32
534 echo "VCARCH=x86" >> $GITHUB_ENV
535 echo "WARCH=ia32" >> $GITHUB_ENV
536 echo "BITS=32" >> $GITHUB_ENV
537 echo "MSYSTEM=MINGW32" >> $GITHUB_ENV
Philip H361f9d22022-06-14 11:35:21 +0100538 fi
K.Takata2da11a42022-09-10 13:03:12 +0100539
540 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
ichizok2f147162023-04-26 15:43:39 +0100541 if ${{ matrix.features != 'TINY' }}; then
542 if ${{ matrix.arch == 'x86' }}; then
K.Takata80613d62022-11-09 16:12:47 +0000543 choco install python2 --no-progress --forcex86
K.Takata2da11a42022-09-10 13:03:12 +0100544 else
K.Takata80613d62022-11-09 16:12:47 +0000545 choco install python2 --no-progress
K.Takata2da11a42022-09-10 13:03:12 +0100546 fi
547 fi
548 python3_dir=$(cat "/proc/$cygreg/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}$pyreg/InstallPath/@")
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100549 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
550
ichizok2f147162023-04-26 15:43:39 +0100551 if ${{ matrix.toolchain == 'msvc' }}; then
552 SODIUM_DIR=D:\\libsodium
553 echo "SODIUM_LIB=${SODIUM_DIR}\\${{ matrix.arch == 'x64' && 'x64' || 'Win32' }}\\Release\\${SODIUM_MSVC_VER}\\dynamic" >> $GITHUB_ENV
554 else
555 SODIUM_DIR=D:\\libsodium-win${{ matrix.arch == 'x64' && '64' || '32' }}
Christian Brabandtf976e2c2024-03-21 20:55:22 +0000556 # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
557 SODIUM_DIR_SLASH=D:/libsodium-win${{ matrix.arch == 'x64' && '64' || '32' }}
ichizok2f147162023-04-26 15:43:39 +0100558 echo "SODIUM_LIB=${SODIUM_DIR}\\bin" >> $GITHUB_ENV
Christian Brabandtf976e2c2024-03-21 20:55:22 +0000559 echo "SODIUM_DIR_SLASH=${SODIUM_DIR_SLASH}" >> $GITHUB_ENV
ichizok2f147162023-04-26 15:43:39 +0100560 fi
561 echo "SODIUM_DIR=${SODIUM_DIR}" >> $GITHUB_ENV
RestorerZ96509102024-07-11 21:14:15 +0200562 echo "GETTEXT_PATH=D:\gettext${{ matrix.arch == 'x64' && '64' || '32' }}" >> $GITHUB_ENV
ichizok2f147162023-04-26 15:43:39 +0100563
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100564 - uses: msys2/setup-msys2@v2
565 if: matrix.toolchain == 'mingw'
566 with:
Philip H361f9d22022-06-14 11:35:21 +0100567 update: true
568 install: tar
569 pacboy: >-
570 make:p gcc:p
K.Takata2da11a42022-09-10 13:03:12 +0100571 msystem: ${{ env.MSYSTEM }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100572 release: false
573
Philip Hbfaa24f2022-06-01 21:26:34 +0100574 - name: Checkout repository from github
dependabot[bot]213c3232023-09-11 19:43:33 +0200575 uses: actions/checkout@v4
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100576
577 - name: Create a list of download URLs
578 shell: cmd
579 run: |
580 type NUL > urls.txt
581 echo %LUA_RELEASE%>> urls.txt
582 echo %WINPTY_URL%>> urls.txt
ichizok2f147162023-04-26 15:43:39 +0100583 echo %SODIUM_VER%>> urls.txt
RestorerZ96509102024-07-11 21:14:15 +0200584 echo %GETTEXT32_URL%>> urls.txt
585 echo %GETTEXT64_URL%>> urls.txt
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100586
587 - name: Cache downloaded files
dependabot[bot]1cee5092024-01-22 20:06:01 +0100588 uses: actions/cache@v4
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100589 with:
590 path: downloads
K.Takata2da11a42022-09-10 13:03:12 +0100591 key: ${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('urls.txt') }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100592
593 - name: Download dependencies
594 shell: cmd
595 run: |
596 path C:\Program Files\7-Zip;%path%
597 if not exist downloads mkdir downloads
598
599 echo %COL_GREEN%Download Lua%COL_RESET%
K.Takata2da11a42022-09-10 13:03:12 +0100600 call :downloadfile %LUA${{ env.BITS }}_URL% downloads\lua.zip
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100601 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
602
603 echo %COL_GREEN%Download winpty%COL_RESET%
604 call :downloadfile %WINPTY_URL% downloads\winpty.zip
605 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
K.Takata2da11a42022-09-10 13:03:12 +0100606 copy /Y D:\winpty\%WARCH%\bin\winpty.dll src\winpty%BITS%.dll
607 copy /Y D:\winpty\%WARCH%\bin\winpty-agent.exe src\
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100608
ichizok2f147162023-04-26 15:43:39 +0100609 echo %COL_GREEN%Download libsodium%COL_RESET%
610 if "${{ matrix.toolchain }}"=="msvc" (
611 call :downloadfile %SODIUM_MSVC_URL% downloads\libsodium.zip
612 7z x -y downloads\libsodium.zip -oD:\ > nul || exit 1
613 ) else (
614 call :downloadfile %SODIUM_MINGW_URL% downloads\libsodium.tar.gz
615 7z x -y downloads\libsodium.tar.gz -so | 7z x -si -ttar -oD:\ > nul || exit 1
616 mklink %SODIUM_LIB%\libsodium.dll %SODIUM_LIB%\libsodium-%SODIUM_MINGW_VER%.dll
617 )
618
RestorerZ96509102024-07-11 21:14:15 +0200619 echo %COL_GREEN%Download Gettext%COL_RESET%
620 call :downloadfile %GETTEXT${{ env.BITS }}_URL% downloads\gettext${{ env.BITS }}.zip
621 7z e -y downloads\gettext${{ env.BITS }}.zip -oD:\gettext${{ env.BITS }} > nul || exit 1
622 copy /y D:\gettext${{ env.BITS }}\libintl-8.dll src\ || exit 1
623 copy /y D:\gettext${{ env.BITS }}\libiconv-2.dll src\ || exit 1
624
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100625 goto :eof
626
627 :downloadfile
628 :: call :downloadfile <URL> <localfile>
629 if not exist %2 (
630 curl -f -L %1 -o %2
631 )
632 if ERRORLEVEL 1 (
633 rem Retry once.
634 curl -f -L %1 -o %2 || exit 1
635 )
636 goto :eof
637
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100638 - name: Build (MSVC)
639 if: matrix.toolchain == 'msvc'
640 shell: cmd
641 run: |
K.Takata2da11a42022-09-10 13:03:12 +0100642 call "%VCVARSALL%" %VCARCH%
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100643 cd src
K.Takata2da11a42022-09-10 13:03:12 +0100644 if "${{ matrix.VIMDLL }}"=="yes" (
645 set GUI=yes
646 ) else (
647 set GUI=${{ matrix.GUI }}
648 )
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +0200649 if "${{ matrix.python3 }}"=="stable" (
650 set PYTHON3_STABLE=yes
651 ) else (
652 set PYTHON3_STABLE=no
653 )
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100654 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000655 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100656 FEATURES=${{ matrix.features }} ^
K.Takata2da11a42022-09-10 13:03:12 +0100657 GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100658 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
659 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
ichizok2f147162023-04-26 15:43:39 +0100660 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +0200661 DYNAMIC_PYTHON3_STABLE_ABI=%PYTHON3_STABLE% ^
Yegappan Lakshmanand2115582025-04-03 21:35:00 +0200662 DYNAMIC_SODIUM=yes SODIUM=%SODIUM_DIR% ^
663 CI_FLAGS=/we4267
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100664 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000665 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100666 FEATURES=${{ matrix.features }} ^
Yegappan Lakshmanand2115582025-04-03 21:35:00 +0200667 GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} ^
668 CI_FLAGS=/we4267
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100669 )
670
671 - name: Build (MinGW)
672 if: matrix.toolchain == 'mingw'
673 shell: msys2 {0}
674 run: |
675 cd src
K.Takata2da11a42022-09-10 13:03:12 +0100676 if [ "${{ matrix.VIMDLL }}" = "yes" ]; then
677 GUI=yes
678 else
679 GUI=${{ matrix.GUI }}
680 fi
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +0200681 if [ "${{ matrix.python3 }}" = "stable" ]; then
682 PYTHON3_STABLE=yes
683 else
684 PYTHON3_STABLE=no
685 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100686 if [ "${{ matrix.features }}" = "HUGE" ]; then
687 mingw32-make -f Make_ming.mak -j2 \
688 FEATURES=${{ matrix.features }} \
K.Takata2da11a42022-09-10 13:03:12 +0100689 GUI=$GUI IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} \
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100690 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100691 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
692 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
Yee Cheng Chinc13b3d12023-08-20 21:18:38 +0200693 DYNAMIC_PYTHON3_STABLE_ABI=${PYTHON3_STABLE} \
Christian Brabandtf976e2c2024-03-21 20:55:22 +0000694 DYNAMIC_SODIUM=yes SODIUM=${SODIUM_DIR_SLASH} \
ichizok0cd3e942022-02-14 11:36:57 +0000695 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100696 else
697 mingw32-make -f Make_ming.mak -j2 \
698 FEATURES=${{ matrix.features }} \
K.Takata2da11a42022-09-10 13:03:12 +0100699 GUI=$GUI IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100700 STATIC_STDCPLUS=yes
701 fi
702
ichizok0cd3e942022-02-14 11:36:57 +0000703 - name: Check version
704 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000705 run: |
K.Takata2da11a42022-09-10 13:03:12 +0100706 PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
707 if "${{ matrix.GUI }}"=="yes" (
708 start /wait src\gvim -u NONE -i NONE -c "redir > version.txt | ver | q" || exit 1
709 type version.txt
710 echo.
711 start /wait src\gvim -u NONE -i NONE -c "redir! > version.txt | so ci\if_ver-1.vim | q"
712 start /wait src\gvim -u NONE -i NONE -c "redir >> version.txt | so ci\if_ver-2.vim | q"
713 type version.txt
714 del version.txt
715 ) else (
716 src\vim --version || exit 1
717 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
718 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
Yee Cheng Chinbb8e5dd2025-03-30 14:48:29 +0200719 if "${{ matrix.features }}"=="HUGE" (
720 src\vim -u NONE -i NONE --not-a-term -esNX -V1 ^
721 -c "let g:required=['gettext', 'sodium', 'sound', 'python3', 'lua']" ^
722 -S ci/if_feat_check.vim -c quit
723 )
K.Takata2da11a42022-09-10 13:03:12 +0100724 )
ichizok0cd3e942022-02-14 11:36:57 +0000725
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100726 #- name: Prepare Artifact
727 # shell: cmd
728 # run: |
729 # mkdir artifacts
730 # copy src\*vim.exe artifacts
731 # copy src\vim*.dll artifacts
732 #
733 #- name: Upload Artifact
734 # uses: actions/upload-artifact@v1
735 # with:
736 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
737 # path: ./artifacts
738
Christian Brabandt73aa24e2025-06-29 17:56:44 +0200739 # disabled because of https://github.com/tunisiano187/Chocolatey-packages/issues/3916
740 #- name: Install packages for testing
741 # shell: bash
742 # run: |
743 # if ${{ matrix.features != 'TINY' }}; then
744 # if ${{ matrix.arch == 'x64' }}; then
745 # choco install netbeans --no-progress
746 # else
747 # exit 0
748 # fi
749 # fi
Philip H.066a5342025-02-23 08:50:54 +0100750
ichizok0cd3e942022-02-14 11:36:57 +0000751 - name: Test and show the result of testing gVim
K.Takata2da11a42022-09-10 13:03:12 +0100752 if: matrix.GUI == 'yes' || matrix.VIMDLL == 'yes'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100753 shell: cmd
K.Takata2da11a42022-09-10 13:03:12 +0100754 timeout-minutes: 15
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100755 run: |
ichizok2f147162023-04-26 15:43:39 +0100756 PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%;%SODIUM_LIB%
K.Takata2da11a42022-09-10 13:03:12 +0100757 call "%VCVARSALL%" %VCARCH%
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100758
ichizok0cd3e942022-02-14 11:36:57 +0000759 echo %COL_GREEN%Test gVim:%COL_RESET%
760 cd src\testdir
K.Takata2da11a42022-09-10 13:03:12 +0100761 if "${{ matrix.GUI }}"=="yes" (
762 nmake -nologo -f Make_mvc.mak VIMPROG=..\gvim || exit 1
763 ) else (
764 @rem Run only tiny tests.
765 nmake -nologo -f Make_mvc.mak tiny VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100766 )
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100767
K.Takata2da11a42022-09-10 13:03:12 +0100768 - name: Test and show the result of testing Vim
769 if: matrix.GUI == 'no' || matrix.VIMDLL == 'yes'
770 shell: cmd
771 timeout-minutes: 15
772 run: |
ichizok2f147162023-04-26 15:43:39 +0100773 PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%;%SODIUM_LIB%
K.Takata2da11a42022-09-10 13:03:12 +0100774 call "%VCVARSALL%" %VCARCH%
ichizok0cd3e942022-02-14 11:36:57 +0000775
K.Takata2da11a42022-09-10 13:03:12 +0100776 echo %COL_GREEN%Test Vim:%COL_RESET%
777 cd src\testdir
778 nmake -nologo -f Make_mvc.mak clean
779 if "${{ matrix.GUI }}"=="no" (
780 nmake -nologo -f Make_mvc.mak VIMPROG=..\vim || exit 1
781 ) else (
782 @rem Run only tiny tests.
783 nmake -nologo -f Make_mvc.mak tiny VIMPROG=..\vim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100784 )
ichizok41ee5b12022-02-12 10:13:13 +0000785
Christian Brabandt8314de82024-05-15 21:48:11 +0200786 - if: ${{ !cancelled() }}
Aliaksei Budaveif1d83c42024-11-02 15:51:14 +0100787 uses: ./.github/actions/test_artifacts
Christian Brabandt8314de82024-05-15 21:48:11 +0200788
ichizok41ee5b12022-02-12 10:13:13 +0000789 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000790 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000791 shell: msys2 {0}
792 run: |
793 cd src
794 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
ichizok41ee5b12022-02-12 10:13:13 +0000795
K.Takata2da11a42022-09-10 13:03:12 +0100796 - name: Codecov
Philip H982ded62023-06-22 18:12:46 +0100797 timeout-minutes: 20
ichizok0cd3e942022-02-14 11:36:57 +0000798 if: matrix.coverage
dependabot[bot]ba9e1572024-11-18 19:05:53 +0100799 uses: codecov/codecov-action@v5
ichizok41ee5b12022-02-12 10:13:13 +0000800 with:
801 directory: src
ichizok41ee5b12022-02-12 10:13:13 +0000802 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}
K.Takatabd2f45a2024-02-10 02:18:11 +0900803 token: ${{ secrets.CODECOV_TOKEN }}