Skip to content

Commit

Permalink
Merged AppVeyor scripts for 'install', 'build' and 'test' into one
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenlau committed Aug 5, 2021
1 parent 761a59f commit e63c3f1
Show file tree
Hide file tree
Showing 23 changed files with 468 additions and 768 deletions.
20 changes: 6 additions & 14 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,16 @@ environment:
CONFIGURATION: RelWithDebInfo
DISABLED_TESTS: (StalenessCheckTest)

#- PROFILE: CYGWIN
# PROFILE_CLASS: CYGWIN
# PLATFORM: x64
# CONFIGURATION: RelWithDebInfo
# DISABLED_TESTS: (ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest)
- PROFILE: CYGWIN
PROFILE_CLASS: CYGWIN
PLATFORM: x64
CONFIGURATION: RelWithDebInfo
DISABLED_TESTS: (ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest)

install:
- cd %APPVEYOR_BUILD_FOLDER%
- call build\appveyor\%PROFILE_CLASS%-appveyor-install.bat
- refreshenv

build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- call build\appveyor\%PROFILE_CLASS%-appveyor-build.bat

test_script:
- cd %APPVEYOR_BUILD_FOLDER%
- call build\appveyor\%PROFILE_CLASS%-appveyor-test.bat
- call build\appveyor\%PROFILE_CLASS%-appveyor-full.bat


# artifact capture disabled as it might increase service cost for little gain:
Expand Down
35 changes: 0 additions & 35 deletions build/appveyor/CYGWIN-appveyor-build.bat

This file was deleted.

96 changes: 96 additions & 0 deletions build/appveyor/CYGWIN-appveyor-full.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
::

::
:: Appveyor script for CYGWIN
::

::
:: Installs third party packages we need for a cmake build
::

@ECHO ON
SETLOCAL EnableDelayedExpansion

CD build\appveyor || EXIT /B

SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor
SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM%
SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\install\%PROFILE%\%PLATFORM%
SET SRCDIR=%APPVEYOR_BUILD_FOLDER%


:: compiler and generator detection
SET COMPILER=gcc
SET GENERATOR=Unix Makefiles

IF "%PLATFORM%" == "x64" (
SET CYGWINROOT=C:\cygwin64
) ELSE (
SET CYGWINROOT=C:\cygwin
)

IF "%PLATFORM%" == "x64" (
SET SETUP=!CYGWINROOT!\setup-x86_64.exe
) ELSE (
SET SETUP=!CYGWINROOT!\setup-x86.exe
)

SET BASH=!CYGWINROOT!\bin\bash.exe
SET BUILDDIR=%BUILDDIR:\=/%
SET BUILDDIR=/cygdrive/c!BUILDDIR:~2!
SET INSTDIR=%INSTDIR:\=/%
SET INSTDIR=/cygdrive/c!INSTDIR:~2!
SET SRCDIR=%SRCDIR:\=/%
SET SRCDIR=/cygdrive/c!SRCDIR:~2!


CALL win_showenv.bat || EXIT /B

::
:: Install apt-cyg for package management because its easier to use
:: than Cygwins setup.exe. But both are possible to use.
::

%BASH% -lc "wget https://rawgit.com/transcode-open/apt-cyg/master/apt-cyg && install apt-cyg /bin && rm -f apt-cyg" || EXIT /B
%BASH% -lc "apt-cyg update" || EXIT /B
%BASH% -lc "apt-cyg install unzip xz cmake make bison flex gcc-g++ libboost-devel libevent-devel openssl-devel zlib-devel" || EXIT /B


::
:: Configure and build our software with cmake
::

SET CMAKEARGS=^
-G'%GENERATOR%' ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DCMAKE_INSTALL_PREFIX=%INSTDIR% ^
-DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" ^
-DWITH_JAVA=OFF ^
-DWITH_PYTHON=OFF

:: -DCMAKE_CXX_EXTENSIONS=ON ^
:: -DCMAKE_CXX_STANDARD=11 ^


%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% && cmake --install . --config %CONFIGURATION%" || EXIT /B


::
:: Execute our tests
::

SET DISABLED_TESTS_COMMAND=--exclude-regex '%DISABLED_TESTS%'

%BASH% -lc "cd %BUILDDIR% && ctest.exe --build-config %CONFIGURATION% --timeout 300 --extra-verbose %DISABLED_TESTS_COMMAND%" || EXIT /B
35 changes: 0 additions & 35 deletions build/appveyor/CYGWIN-appveyor-install.bat

This file was deleted.

21 changes: 0 additions & 21 deletions build/appveyor/CYGWIN-appveyor-test.bat

This file was deleted.

34 changes: 0 additions & 34 deletions build/appveyor/MINGW-appveyor-build.bat

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,59 @@
::

::
:: Appveyor install script for MINGW on MSYS2
:: Appveyor script for MINGW on MSYS2
::

::
:: Installs third party packages we need for a cmake build
::

@ECHO OFF
@ECHO ON
SETLOCAL EnableDelayedExpansion

CD build\appveyor || EXIT /B
CALL win_banner_install.bat || EXIT /B
CALL win_setenv.bat || EXIT /B

SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor
SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM%
SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\install\%PROFILE%\%PLATFORM%
SET SRCDIR=%APPVEYOR_BUILD_FOLDER%


:: PLATFORM is x86 or x64
:: NORM_PLATFORM is 32 or 64
IF "%PLATFORM%" == "x86" (
SET NORM_PLATFORM=32
) ELSE (
SET NORM_PLATFORM=64
)

:: PLATFORM = x86 means MINGWPLAT i686
:: PLATFORM = x64 means MINGWPLAT x86_64
IF "%PLATFORM%" == "x86" (
SET MINGWPLAT=i686
) ELSE (
SET MINGWPLAT=x86_64
)


:: compiler and generator detection
SET COMPILER=gcc
SET GENERATOR=MinGW Makefiles


SET BASH=C:\msys64\usr\bin\bash.exe
!BASH! -lc "sed -i '/export PATH=\/mingw32\/bin/d' ~/.bash_profile && sed -i '/export PATH=\/mingw64\/bin/d' ~/.bash_profile && echo 'export PATH=/mingw%NORM_PLATFORM%/bin:$PATH' >> ~/.bash_profile" || EXIT /B

SET BUILDDIR=%BUILDDIR:\=/%
SET BUILDDIR=/c!BUILDDIR:~2!
SET INSTDIR=%INSTDIR:\=/%
SET INSTDIR=/c!INSTDIR:~2!
SET SRCDIR=%SRCDIR:\=/%
SET SRCDIR=/c!SRCDIR:~2!

CALL win_showenv.bat || EXIT /B


SET PACKAGES=^
base-devel ^
mingw-w64-x86_64-toolchain ^
Expand Down Expand Up @@ -57,3 +98,29 @@ SET PACKAGES=^
::%BASH% -lc "pacman --noconfirm -Sy" || EXIT /B
::%BASH% -lc "pacman --noconfirm -Udd https://repo.msys2.org/msys/x86_64/pacman-5.2.2-5-x86_64.pkg.tar.xz" || EXIT /B
::%BASH% -lc "pacman --noconfirm --needed -S %PACKAGES%" || EXIT /B


::
:: Configure and build our software with cmake
::

SET CMAKEARGS=^
-G'%GENERATOR%' ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DCMAKE_INSTALL_PREFIX=%INSTDIR% ^
-DCMAKE_MAKE_PROGRAM=/mingw%NORM_PLATFORM%/bin/mingw32-make ^
-DCMAKE_C_COMPILER=/mingw%NORM_PLATFORM%/bin/gcc.exe ^
-DCMAKE_CXX_COMPILER=/mingw%NORM_PLATFORM%/bin/g++.exe ^
-DOPENSSL_ROOT_DIR=/mingw%NORM_PLATFORM% ^
-DWITH_PYTHON=OFF

%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% && cmake --install . --config %CONFIGURATION%" || EXIT /B


::
:: Execute our tests
::

SET DISABLED_TESTS_COMMAND=--exclude-regex '%DISABLED_TESTS%'

%BASH% -lc "cd %BUILDDIR% && ctest.exe --build-config %CONFIGURATION% --timeout 300 --extra-verbose %DISABLED_TESTS_COMMAND%" || EXIT /B
22 changes: 0 additions & 22 deletions build/appveyor/MINGW-appveyor-test.bat

This file was deleted.

Loading

0 comments on commit e63c3f1

Please sign in to comment.