CI: Move some Appveyor builds to GitHub actions (#791)

AppVeyor has gotten progressively slower over the last year or so. Move
some Windows builds to GitHub actions which is considerably faster.

Fix By: Brad House (@bradh352)
pull/792/head
Brad House 5 months ago committed by GitHub
parent 1a5bd3b15c
commit d3642a6aeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .github/workflows/codespell.yml
  2. 69
      .github/workflows/msys2.yml
  3. 4
      .github/workflows/netbsd.yml
  4. 4
      .github/workflows/openbsd.yml
  5. 5
      .github/workflows/reuse.yml
  6. 53
      appveyor.yml
  7. 64
      configure.ac

@ -6,14 +6,11 @@ name: Codespell
on: on:
push: push:
branches:
- main
paths: paths:
- 'src/**' - 'src/**'
- 'include/**' - 'include/**'
pull_request: pull_request:
branches: paths:
- main
- 'src/**' - 'src/**'
- 'include/**' - 'include/**'

@ -0,0 +1,69 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: MSYS2 (Windows)
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: true
max-parallel: 2
matrix:
include:
- { msystem: MINGW64, env: x86_64, cmake_opts: "" }
- { msystem: MINGW32, env: i686, cmake_opts: "" }
- { msystem: UCRT64, env: ucrt-x86_64, cmake_opts: "" }
- { msystem: CLANG64, env: clang-x86_64, cmake_opts: "-DCMAKE_CXX_FLAGS=-fsanitize=undefined -DCMAKE_C_FLAGS=-fsanitize=undefined -DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=undefined -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=undefined" }
defaults:
run:
shell: msys2 {0}
name: ${{ matrix.msystem }}
steps:
- name: Install MSYS2 and base packages
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
autoconf
autoconf-archive
automake
libtool
make
mingw-w64-${{ matrix.env }}-cmake
mingw-w64-${{ matrix.env }}-ninja
mingw-w64-${{ matrix.env }}-gtest
- name: Install gcc compiler
if: ${{ matrix.env != 'clang-x86_64' }}
run: |
pacman --noconfirm -S --needed mingw-w64-${{ matrix.env }}-gcc
- name: Install clang compiler
if: ${{ matrix.env == 'clang-x86_64' }}
run: |
pacman --noconfirm -S --needed mingw-w64-${{ matrix.env }}-clang mingw-w64-${{ matrix.env }}-clang-analyzer
- name: Checkout c-ares
uses: actions/checkout@v4
- name: "CMake: build and test c-ares"
run: |
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=C:/projects/build-cares/test_install -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON ${{ matrix.cmake_opts }} -Bbuild_cmake -G Ninja .
cmake --build build_cmake
./build_cmake/bin/adig.exe www.google.com
./build_cmake/bin/ahost.exe www.google.com
./build_cmake/bin/arestest.exe -4 -v --gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*:*LiveGetLocalhostByAddr*
- name: "Autotools: build and test c-ares"
run: |
autoreconf -fi
mkdir build_autotools
cd build_autotools
../configure --enable-static --disable-shared --enable-tests
make -j3
./src/tools/adig.exe www.google.com
./src/tools/ahost.exe www.google.com
./test/arestest.exe -4 -v --gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*:*LiveGetLocalhostByAddr*

@ -4,11 +4,7 @@ name: NetBSD
on: on:
push: push:
branches:
- main
pull_request: pull_request:
branches:
- main
jobs: jobs:
test: test:

@ -3,11 +3,7 @@
name: OpenBSD name: OpenBSD
on: on:
push: push:
branches:
- main
pull_request: pull_request:
branches:
- main
jobs: jobs:
test: test:

@ -6,12 +6,7 @@ name: REUSE compliance
on: on:
push: push:
branches:
- main
- '*/ci'
pull_request: pull_request:
branches:
- main
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

@ -47,48 +47,6 @@ environment:
CMAKE_EXTRA_OPTIONS: -GNinja -DCARES_BUILD_TESTS=ON -DGTEST_ROOT=C:\projects\googletest -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL CMAKE_EXTRA_OPTIONS: -GNinja -DCARES_BUILD_TESTS=ON -DGTEST_ROOT=C:\projects\googletest -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
BUILD_GOOGLETEST: yes BUILD_GOOGLETEST: yes
# MinGW gcc via MSYS2 (latest version)
- COMPILER: MINGW
CONFTOOL: CMAKE
SYSTEM: MSYS2
SKIP_TESTS: no
MSYSTEM: MINGW64
TOOLSDIR: ./build/bin
TESTDIR: ./build/bin
CMAKE_EXTRA_OPTIONS: -GNinja
CHERE_INVOKING: YES
# MinGW gcc via MSYS2 using autotools
- COMPILER: MINGW
CONFTOOL: AUTOTOOLS
SKIP_TESTS: no
SYSTEM: MSYS2
MSYSTEM: MINGW64
TOOLSDIR: ./src/tools
TESTDIR: ./test
CHERE_INVOKING: YES
# MinGW clang UBSAN via MSYS2
- COMPILER: MINGW
CONFTOOL: CMAKE
SKIP_TESTS: no
SYSTEM: MSYS2
MSYSTEM: CLANG64
TOOLSDIR: ./build/bin
TESTDIR: ./build/bin
CMAKE_EXTRA_OPTIONS: -GNinja -DCMAKE_CXX_FLAGS=-fsanitize=undefined -DCMAKE_C_FLAGS=-fsanitize=undefined -DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=undefined -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=undefined
CHERE_INVOKING: YES
# MinGW clang ASAN via MSYS2 -- doesn't work due to some issue with clang itself
# - COMPILER: MINGW
# CONFTOOL: CMAKE
# SKIP_TESTS: no
# SYSTEM: MSYS2
# MSYSTEM: CLANG64
# TESTDIR: ./cmakebld/bin
# CMAKE_EXTRA_OPTIONS: -GNinja -DCMAKE_CXX_FLAGS=-fsanitize=address -DCMAKE_C_FLAGS=-fsanitize=address -DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=address -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=address
# CHERE_INVOKING: YES
# MSVC 2022, 64-bit x86 (nmake) # MSVC 2022, 64-bit x86 (nmake)
- COMPILER: MSVC - COMPILER: MSVC
CONFTOOL: NMAKE CONFTOOL: NMAKE
@ -145,9 +103,6 @@ before_build:
# Setup build environment for the selected compiler (not all compilers need to do anything here). # Setup build environment for the selected compiler (not all compilers need to do anything here).
# -- Visual Studio -- # -- Visual Studio --
- if "%COMPILER%" == "MSVC" call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG% - if "%COMPILER%" == "MSVC" call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG%
- if "%SYSTEM%" == "MSYS2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
- if "%SYSTEM%" == "MSYS2" if "%MSYSTEM%" == "MINGW64" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syu autoconf autoconf-archive automake libtool make git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-gtest"
- if "%SYSTEM%" == "MSYS2" if "%MSYSTEM%" == "CLANG64" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syu autoconf autoconf-archive automake libtool make git mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-clang-analyzer mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-gtest"
- if "%BUILD_GOOGLETEST%" == "yes" git clone --depth=1 https://github.com/google/googletest googletest - if "%BUILD_GOOGLETEST%" == "yes" git clone --depth=1 https://github.com/google/googletest googletest
- if "%BUILD_GOOGLETEST%" == "yes" cd googletest - if "%BUILD_GOOGLETEST%" == "yes" cd googletest
- if "%BUILD_GOOGLETEST%" == "yes" cmake -DCMAKE_INSTALL_PREFIX=C:\projects\googletest -DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -GNinja -Bbuild - if "%BUILD_GOOGLETEST%" == "yes" cmake -DCMAKE_INSTALL_PREFIX=C:\projects\googletest -DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -GNinja -Bbuild
@ -156,11 +111,6 @@ before_build:
- if "%BUILD_GOOGLETEST%" == "yes" cd .. - if "%BUILD_GOOGLETEST%" == "yes" cd ..
build_script: build_script:
- if "%SYSTEM%" == "MSYS2" if "%CONFTOOL%" == "CMAKE" C:\msys64\usr\bin\bash -lc "%ANALYZE_PREFIX% cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=C:/projects/build-cares/test_install -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON %CMAKE_EXTRA_OPTIONS% -Bbuild ."
- if "%SYSTEM%" == "MSYS2" if "%CONFTOOL%" == "CMAKE" C:\msys64\usr\bin\bash -lc "%ANALYZE_PREFIX% cmake --build build"
- if "%SYSTEM%" == "MSYS2" if "%CONFTOOL%" == "AUTOTOOLS" C:\msys64\usr\bin\bash -lc "./buildconf"
- if "%SYSTEM%" == "MSYS2" if "%CONFTOOL%" == "AUTOTOOLS" C:\msys64\usr\bin\bash -lc "%ANALYZE_PREFIX% ./configure --enable-static --disable-shared --enable-tests"
- if "%SYSTEM%" == "MSYS2" if "%CONFTOOL%" == "AUTOTOOLS" C:\msys64\usr\bin\bash -lc "%ANALYZE_PREFIX% make"
- if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" copy .\include\ares_build.h.dist .\include\ares_build.h - if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" copy .\include\ares_build.h.dist .\include\ares_build.h
- if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc - if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc
- if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "CMAKE" cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=C:\projects\build-cares\test_install -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON %CMAKE_EXTRA_OPTIONS% -Bbuild - if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "CMAKE" cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=C:\projects\build-cares\test_install -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON %CMAKE_EXTRA_OPTIONS% -Bbuild
@ -171,9 +121,6 @@ build_script:
test_script: test_script:
# We can't use powershell for tests due to treating stderr as an error # We can't use powershell for tests due to treating stderr as an error
- if "%SYSTEM%" == "MSYS2" if not "%SKIP_TESTS%" == "yes" C:\msys64\usr\bin\bash -lc "%TOOLSDIR%/adig.exe www.google.com"
- if "%SYSTEM%" == "MSYS2" if not "%SKIP_TESTS%" == "yes" C:\msys64\usr\bin\bash -lc "%TOOLSDIR%/ahost.exe www.google.com"
- if "%SYSTEM%" == "MSYS2" if not "%SKIP_TESTS%" == "yes" C:\msys64\usr\bin\bash -lc "%TESTDIR%/arestest.exe -4 -v --gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*:*LiveGetLocalhostByAddr*"
- if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" if not "%SKIP_TESTS%" == "yes" cd test - if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" if not "%SKIP_TESTS%" == "yes" cd test
- if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" if not "%SKIP_TESTS%" == "yes" nmake GTEST_ROOT=C:\projects\googletest /NOLOGO /f .\Makefile.msvc vtest - if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" if not "%SKIP_TESTS%" == "yes" nmake GTEST_ROOT=C:\projects\googletest /NOLOGO /f .\Makefile.msvc vtest
- if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" if not "%SKIP_TESTS%" == "yes" nmake GTEST_ROOT=C:\projects\googletest /NOLOGO /f .\Makefile.msvc aresfuzz aresfuzzname dnsdump - if "%SYSTEM%" == "CONSOLE" if "%CONFTOOL%" == "NMAKE" if not "%SKIP_TESTS%" == "yes" nmake GTEST_ROOT=C:\projects\googletest /NOLOGO /f .\Makefile.msvc aresfuzz aresfuzzname dnsdump

@ -294,17 +294,7 @@ if test "$ac_cv_native_windows" = "yes" ; then
dnl other headers, AC_CHECK_HEADERS only allows you to specify headers that dnl other headers, AC_CHECK_HEADERS only allows you to specify headers that
dnl must be included *before* the header being checked. dnl must be included *before* the header being checked.
AC_CHECK_HEADERS( AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h iphlpapi.h netioapi.h ws2ipdef.h winternl.h ntdef.h ntstatus.h mswsock.h ],
windows.h \
winsock2.h \
ws2tcpip.h \
iphlpapi.h \
netioapi.h \
ws2ipdef.h \
winternl.h \
ntdef.h \
ntstatus.h \
mswsock.h,
[], [], [-]) [], [], [-])
dnl Windows builds require linking to iphlpapi dnl Windows builds require linking to iphlpapi
@ -406,42 +396,10 @@ AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
) )
dnl check for a few basic system headers we need dnl check for a few basic system headers we need. It would be nice if we could
AC_CHECK_HEADERS( dnl split these on separate lines, but for some reason autotools on Windows doesn't
malloc.h \ dnl allow this, even tried ending lines with a backslash.
memory.h \ AC_CHECK_HEADERS([malloc.h memory.h AvailabilityMacros.h sys/types.h sys/time.h sys/select.h sys/socket.h sys/filio.h sys/ioctl.h sys/param.h sys/uio.h sys/random.h sys/event.h sys/epoll.h assert.h iphlpapi.h netioapi.h netdb.h netinet/in.h netinet6/in6.h netinet/tcp.h net/if.h ifaddrs.h fcntl.h errno.h socket.h strings.h stdbool.h time.h poll.h limits.h arpa/nameser.h arpa/nameser_compat.h arpa/inet.h ],
AvailabilityMacros.h \
sys/types.h \
sys/time.h \
sys/select.h \
sys/socket.h \
sys/filio.h \
sys/ioctl.h \
sys/param.h \
sys/uio.h \
sys/random.h \
sys/event.h \
sys/epoll.h \
assert.h \
iphlpapi.h \
netioapi.h \
netdb.h \
netinet/in.h \
netinet6/in6.h \
netinet/tcp.h \
net/if.h \
ifaddrs.h \
fcntl.h \
errno.h \
socket.h \
strings.h \
stdbool.h \
time.h \
poll.h \
limits.h \
arpa/nameser.h \
arpa/nameser_compat.h \
arpa/inet.h,
dnl to do if not found dnl to do if not found
[], [],
dnl to do if found dnl to do if found
@ -902,12 +860,12 @@ AC_SUBST(AM_CPPFLAGS)
AC_SUBST(PKGCONFIG_CFLAGS) AC_SUBST(PKGCONFIG_CFLAGS)
AC_SUBST(BUILD_SUBDIRS) AC_SUBST(BUILD_SUBDIRS)
AC_CONFIG_FILES([Makefile \ AC_CONFIG_FILES([Makefile
include/Makefile \ include/Makefile
src/Makefile \ src/Makefile
src/lib/Makefile \ src/lib/Makefile
src/tools/Makefile \ src/tools/Makefile
docs/Makefile \ docs/Makefile
libcares.pc ]) libcares.pc ])
AM_COND_IF([BUILD_TESTS], AM_COND_IF([BUILD_TESTS],
[AC_CONFIG_FILES([test/Makefile])]) [AC_CONFIG_FILES([test/Makefile])])

Loading…
Cancel
Save