appveyor.yml: Initial attempt to use AppVeyor for Linux builds.

- Temporarily disabled most of the Windows builds.

- Added Linux build scripts, including a script run as root to
  install packages via `apt-get`.
This commit is contained in:
David Korth 2022-08-30 18:01:03 -04:00
parent ec60027523
commit 6a91ee5759
4 changed files with 107 additions and 30 deletions

38
appveyor-dpkg.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
set -ev
apt-get update
apt-get -y install \
libcurl4-openssl-dev \
zlib1g-dev \
libpng-dev \
libjpeg-dev \
nettle-dev \
pkg-config \
libtinyxml2-dev \
gettext \
libseccomp-dev \
\
libzstd-dev \
liblz4-dev \
liblzo2-dev \
\
libqt4-dev \
kdelibs5-dev \
\
qtbase5-dev \
qttools5-dev-tools \
extra-cmake-modules \
libkf5kio-dev \
libkf5widgetsaddons-dev \
libkf5filemetadata-dev \
\
libglib2.0-dev \
libgtk2.0-dev \
libgdk-pixbuf2.0-dev \
libthunarx-2-dev \
libcanberra-dev \
libgsound-dev \
libgtk-3-dev \
libcairo2-dev \
libnautilus-extension-dev

View File

@ -21,7 +21,7 @@ set CMAKE_GENERATOR_TOOLSET=v140_xp
if "%platform%" == "x64" set "CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64"
mkdir build
cd build
cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_GENERATOR_TOOLSET=%CMAKE_GENERATOR_TOOLSET% -DENABLE_EXTRA_SECURITY=ON -DENABLE_JPEG=ON -DBUILD_TESTING=ON -DENABLE_LTO=OFF -DENABLE_PCH=ON %OPTFEAT%
cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_GENERATOR_TOOLSET=%CMAKE_GENERATOR_TOOLSET% -DBUILD_TESTING=ON -DENABLE_LTO=OFF -DENABLE_PCH=ON %OPTFEAT%
exit /b %ERRORLEVEL%
:mingw-w64
@ -35,5 +35,5 @@ set "PATH=%MINGW64_ROOT%\bin;%PATH%"
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_PREFIX_PATH=%MINGW64_ROOT% -DCMAKE_C_COMPILER=%MINGW64_ROOT%/bin/gcc.exe -DCMAKE_CXX_COMPILER=%MINGW64_ROOT%/bin/g++.exe -DCMAKE_BUILD_TYPE=%configuration% -DENABLE_JPEG=ON -DBUILD_TESTING=ON -DENABLE_LTO=OFF -DENABLE_PCH=ON %OPTFEAT%
cmake .. -G "Ninja" -DCMAKE_PREFIX_PATH=%MINGW64_ROOT% -DCMAKE_C_COMPILER=%MINGW64_ROOT%/bin/gcc.exe -DCMAKE_CXX_COMPILER=%MINGW64_ROOT%/bin/g++.exe -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_TESTING=ON -DENABLE_LTO=OFF -DENABLE_PCH=ON %OPTFEAT%
exit /b %ERRORLEVEL%

16
appveyor.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -ev
cmake --version
# Enable or disable optional features?
if [ "$1" = "OFF" ]; then
export OPTEN=OFF
else
export OPTEN=ON
fi
OPTFEAT="-DENABLE_EXTRA_SECURITY=${OPTEN} -DENABLE_JPEG=${OPTEN} -DENABLE_XML=${OPTEN} -DENABLE_DECRYPTION=${OPTEN} -DENABLE_UNICE68=${OPTEN} -DENABLE_LIBMSPACK=${OPTEN} -DENABLE_PVRTC=${OPTEN} -DENABLE_ZSTD=${OPTEN} -DENABLE_LZ4=${OPTEN} -DENABLE_LZO=${OPTEN}"
mkdir build
cd build
cmake .. -G Ninja -DBUILD_TESTING=ON -DENABLE_LTO=OFF -DENABLE_PCH=OFF %OPTFEAT%

View File

@ -2,7 +2,9 @@
version: '1.9.0.{build}'
# Build worker image (VM template)
image: Visual Studio 2015
image:
- Visual Studio 2015
- Ubuntu
# scripts that are called at very beginning, before repo cloning
init:
@ -14,7 +16,6 @@ clone_folder: c:\projects\rom-properties
# Don't build if source files aren't modified.
only_commits:
files:
- appveyor.cmd
- appveyor.yml
- '**/CMakeLists.txt'
- '**/*.cmd'
@ -24,49 +25,71 @@ only_commits:
environment:
matrix:
- platform: x86
- image: Visual Studio 2015
platform: x86
configuration: Debug
compiler: msvc2015
- platform: x86
configuration: Release
compiler: msvc2015
#- image: Visual Studio 2015
# platform: x86
# configuration: Release
# compiler: msvc2015
- platform: x64
configuration: Debug
compiler: msvc2015
#- image: Visual Studio 2015
# platform: x64
# configuration: Debug
# compiler: msvc2015
- platform: x64
configuration: Release
compiler: msvc2015
#- image: Visual Studio 2015
# platform: x64
# configuration: Release
# compiler: msvc2015
#- platform: x86
# NOTE: This one stays disabled after finishing Ubuntu testing.
#- image: Visual Studio 2015
# platform: x86
# configuration: Debug
# compiler: mingw-w64
- platform: x64
configuration: Debug
compiler: mingw-w64
#- image: Visual Studio 2015
# platform: x64
# configuration: Debug
# compiler: mingw-w64
- image: Ubuntu
platform: x64
configuration: Release
# Run CMake with optional features turned off initially.
before_build:
- cd %APPVEYOR_BUILD_FOLDER%
- appveyor.cmd OFF
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: appveyor.cmd OFF
- sh: cd ${APPVEYOR_BUILD_FOLDER}
- sh: sudo ./appveyor-dpkg.sh
- sh: ./appveyor.sh OFF
# Build once with optional features turned off,
# then build again with optional features turned on.
build_script:
- cd %APPVEYOR_BUILD_FOLDER%\build
- cmake --build . --config %configuration%
- cd ..
- appveyor.cmd ON
- cd %APPVEYOR_BUILD_FOLDER%\build
- cmake --build . --config %configuration%
- cmd: cd %APPVEYOR_BUILD_FOLDER%\build
- cmd: cmake --build . --config %configuration%
- cmd: cd ..
- cmd: appveyor.cmd ON
- cmd: cd %APPVEYOR_BUILD_FOLDER%\build
- cmd: cmake --build . --config %configuration%
- sh: cd ${APPVEYOR_BUILD_FOLDER}/build
- sh: cmake --build . --config ${configuration}
- sh: cd ..
- sh: ./appveyor.sh ON
- sh: cd ${APPVEYOR_BUILD_FOLDER}/build
- sh: cmake --build . --config ${configuration}
test_script:
- cd %APPVEYOR_BUILD_FOLDER%\build
- ctest -V -C %configuration%
- cmd: cd %APPVEYOR_BUILD_FOLDER%\build
- cmd: ctest -V -C %configuration%
- sh: cd ${APPVEYOR_BUILD_FOLDER}/build
- sh: ctest -V -C ${configuration}
after_test:
- cd %APPVEYOR_BUILD_FOLDER%\build
- ..\appveyor-artifacts.cmd
- cmd: cd %APPVEYOR_BUILD_FOLDER%\build
- cmd: ..\appveyor-artifacts.cmd