ci: Add a new top-level directory, dedicated for CI verification

Update the ci_*.sh scripts and move them to the more conventional
ci/ directory. Update .appveyor.yml and .travis.yml, as well as
the AUTHORS file, accordingly.

Speed up ci_cmake.sh: add "-DPNG_TESTS=OFF" to the list of CMake
variables if CI_NO_TEST is true.

Remove "sudo: false" from .travis.yml.

Refactor .appveyor.yml.
This commit is contained in:
Cosmin Truta
2020-05-18 21:30:30 -04:00
parent 28c0f8895e
commit 3676fd324a
6 changed files with 60 additions and 61 deletions

View File

@@ -13,58 +13,57 @@ environment:
matrix: matrix:
- TOOLCHAIN: vstudio - TOOLCHAIN: vstudio
AUTOMATION: cmake AUTOMATION: cmake
CI_CMAKE_GENERATOR: Visual Studio 16 2019 ARCH: x86
CI_CMAKE_GENERATOR_PLATFORM: Win32
- TOOLCHAIN: vstudio - TOOLCHAIN: vstudio
AUTOMATION: cmake AUTOMATION: cmake
CI_CMAKE_GENERATOR: Visual Studio 16 2019 ARCH: x64
CI_CMAKE_GENERATOR_PLATFORM: X64
- TOOLCHAIN: vstudio - TOOLCHAIN: vstudio
AUTOMATION: cmake AUTOMATION: cmake
CI_CMAKE_GENERATOR: Visual Studio 16 2019 ARCH: arm64
CI_CMAKE_GENERATOR_PLATFORM: ARM64
CI_NO_TEST: 1 CI_NO_TEST: 1
- TOOLCHAIN: msys2 - TOOLCHAIN: msys2
AUTOMATION: cmake AUTOMATION: cmake
CI_CMAKE_GENERATOR: Unix Makefiles ARCH: i686
CI_CC: i686-w64-mingw32-gcc
- TOOLCHAIN: msys2 - TOOLCHAIN: msys2
AUTOMATION: cmake AUTOMATION: cmake
CI_CMAKE_GENERATOR: Unix Makefiles ARCH: x86_64
CI_CC: x86_64-w64-mingw32-gcc
- TOOLCHAIN: msys2 - TOOLCHAIN: msys2
AUTOMATION: autotools AUTOMATION: autotools
CI_CC: i686-w64-mingw32-gcc ARCH: i686
- TOOLCHAIN: msys2 - TOOLCHAIN: msys2
AUTOMATION: autotools AUTOMATION: autotools
CI_CC: x86_64-w64-mingw32-gcc ARCH: x86_64
- TOOLCHAIN: msys2 - TOOLCHAIN: msys2
AUTOMATION: legacy AUTOMATION: legacy
CI_CC: i686-w64-mingw32-gcc ARCH: i686
- TOOLCHAIN: msys2 - TOOLCHAIN: msys2
AUTOMATION: legacy AUTOMATION: legacy
CI_CC: x86_64-w64-mingw32-gcc ARCH: x86_64
install: install:
- 'if "%TOOLCHAIN%"=="vstudio" if "%CI_CMAKE_GENERATOR_PLATFORM%"=="Win32" C:\tools\vcpkg\vcpkg.exe install zlib:x86-windows' - 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
- 'if "%TOOLCHAIN%"=="vstudio" if "%CI_CMAKE_GENERATOR_PLATFORM%"=="X64" C:\tools\vcpkg\vcpkg.exe install zlib:x64-windows'
- 'if "%TOOLCHAIN%"=="vstudio" if "%CI_CMAKE_GENERATOR_PLATFORM%"=="ARM64" C:\tools\vcpkg\vcpkg.exe install zlib:arm64-windows'
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install' - 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
before_build: before_build:
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_VARS=-DCMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake' - 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_VARS=-DCMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
- 'if "%TOOLCHAIN%"=="msys2" if "%CI_CC%"=="i686-w64-mingw32-gcc" set PATH=C:\msys64\mingw32\bin;%PATH%' - 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 16 2019'
- 'if "%TOOLCHAIN%"=="msys2" if "%CI_CC%"=="x86_64-w64-mingw32-gcc" set PATH=C:\msys64\mingw64\bin;%PATH%' - 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=X64'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" set CI_CMAKE_GENERATOR=Unix Makefiles'
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set PATH=C:\msys64\mingw32\bin;%PATH%'
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set PATH=C:\msys64\mingw64\bin;%PATH%'
- 'if "%TOOLCHAIN%"=="msys2" set CI_CC=%ARCH%-w64-mingw32-gcc'
- 'set CI_CMAKE_BUILD_FLAGS=--parallel 2' - 'set CI_CMAKE_BUILD_FLAGS=--parallel 2'
- 'set CI_CTEST_FLAGS=--parallel 2' - 'set CI_CTEST_FLAGS=--parallel 2'
- 'set CI_MAKE_FLAGS=-j2' - 'set CI_MAKE_FLAGS=-j2'
- 'set CI_LEGACY_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std' - 'set CI_LEGACY_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
build_script: build_script:
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\scripts\ci_cmake.sh"' - 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_cmake.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\scripts\ci_cmake.sh"' - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_cmake.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="autotools" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\scripts\ci_autotools.sh"' - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="autotools" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_autotools.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="legacy" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\scripts\ci_legacy.sh"' - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="legacy" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_legacy.sh"'
cache: cache:
- C:\tools\vcpkg\installed - C:\tools\vcpkg\installed

View File

@@ -38,6 +38,4 @@ before_script:
- 'export CI_LEGACY_MAKEFILES="scripts/makefile.$TRAVIS_COMPILER scripts/makefile.std"' - 'export CI_LEGACY_MAKEFILES="scripts/makefile.$TRAVIS_COMPILER scripts/makefile.std"'
script: script:
- './scripts/ci_$AUTOMATION.sh' - './ci/ci_$AUTOMATION.sh'
sudo: false

View File

@@ -38,8 +38,8 @@ Authors, for copyright and licensing purposes.
- Dan Field - Dan Field
The build projects, the build scripts, the test scripts, and other The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have other files in the "ci", "projects", "scripts" and "tests" directories, have
copyright owners, but are released under the libpng license. other copyright owners, but are released under the libpng license.
Some files in the "contrib" directory, and some tools-generated files Some files in the "contrib" directory, and some tools-generated files
that are distributed with libpng, have other copyright owners, and are that are distributed with libpng, have other copyright owners, and are

View File

@@ -7,13 +7,13 @@ set -e
# Copyright (c) 2019-2020 Cosmin Truta. # Copyright (c) 2019-2020 Cosmin Truta.
# #
# This software is released under the libpng license. # This software is released under the libpng license.
# For conditions of distribution and use, see the disclaimer and license # For conditions of distribution and use, see the disclaimer
# in png.h. # and license in png.h.
CI_SCRIPTNAME="$(basename "$0")" readonly CI_SCRIPTNAME="$(basename "$0")"
CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" readonly CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")" readonly CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")"
CI_BUILDDIR="$CI_SRCDIR/out/autotools.build" readonly CI_BUILDDIR="$CI_SRCDIR/out/autotools.build"
function ci_info { function ci_info {
printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*" printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*"
@@ -52,11 +52,11 @@ function ci_init_autotools {
} }
function ci_build_autotools { function ci_build_autotools {
# Initialize the configure environment. # Export the configure build environment.
[[ $CI_CC ]] && export CC="$CI_CC" [[ $CI_CC ]] && ci_spawn export CC="$CI_CC"
[[ $CI_CC_FLAGS ]] && export CFLAGS="$CI_CC_FLAGS" [[ $CI_CC_FLAGS ]] && ci_spawn export CFLAGS="$CI_CC_FLAGS"
[[ $CI_SANITIZERS ]] && export CFLAGS="-fsanitize=$CI_SANITIZERS -O2 $CFLAGS" [[ $CI_SANITIZERS ]] && ci_spawn export CFLAGS="-fsanitize=$CI_SANITIZERS -O2 $CFLAGS"
# Build. # Build!
ci_spawn rm -fr "$CI_BUILDDIR" ci_spawn rm -fr "$CI_BUILDDIR"
ci_spawn mkdir -p "$CI_BUILDDIR" ci_spawn mkdir -p "$CI_BUILDDIR"
ci_spawn cd "$CI_BUILDDIR" ci_spawn cd "$CI_BUILDDIR"

View File

@@ -7,13 +7,13 @@ set -e
# Copyright (c) 2019-2020 Cosmin Truta. # Copyright (c) 2019-2020 Cosmin Truta.
# #
# This software is released under the libpng license. # This software is released under the libpng license.
# For conditions of distribution and use, see the disclaimer and license # For conditions of distribution and use, see the disclaimer
# in png.h. # and license in png.h.
CI_SCRIPTNAME="$(basename "$0")" readonly CI_SCRIPTNAME="$(basename "$0")"
CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" readonly CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")" readonly CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")"
CI_BUILDDIR="$CI_SRCDIR/out/cmake.build" readonly CI_BUILDDIR="$CI_SRCDIR/out/cmake.build"
function ci_info { function ci_info {
printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*" printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*"
@@ -53,14 +53,12 @@ function ci_init_cmake {
ci_info "environment option: \$CI_SANITIZERS='$CI_SANITIZERS'" ci_info "environment option: \$CI_SANITIZERS='$CI_SANITIZERS'"
ci_info "environment option: \$CI_NO_TEST='$CI_NO_TEST'" ci_info "environment option: \$CI_NO_TEST='$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_CLEAN='$CI_NO_CLEAN'" ci_info "environment option: \$CI_NO_CLEAN='$CI_NO_CLEAN'"
# Print the CMake/CTest program versions.
ci_spawn "$(command -v "$CI_CMAKE")" --version
ci_spawn "$(command -v "$CI_CTEST")" --version
} }
function ci_build_cmake { function ci_build_cmake {
# Initialize the CMake environment.
[[ $CI_CMAKE_GENERATOR ]] &&
export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] &&
export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
# Initialize ALL_CC_FLAGS as a string. # Initialize ALL_CC_FLAGS as a string.
local ALL_CC_FLAGS="$CI_CC_FLAGS" local ALL_CC_FLAGS="$CI_CC_FLAGS"
[[ $CI_SANITIZERS ]] && ALL_CC_FLAGS="-fsanitize=$CI_SANITIZERS $ALL_CC_FLAGS" [[ $CI_SANITIZERS ]] && ALL_CC_FLAGS="-fsanitize=$CI_SANITIZERS $ALL_CC_FLAGS"
@@ -71,10 +69,14 @@ function ci_build_cmake {
[[ $ALL_CC_FLAGS ]] && ALL_CMAKE_VARS+=("-DCMAKE_C_FLAGS=$ALL_CC_FLAGS") [[ $ALL_CC_FLAGS ]] && ALL_CMAKE_VARS+=("-DCMAKE_C_FLAGS=$ALL_CC_FLAGS")
ALL_CMAKE_VARS+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE") ALL_CMAKE_VARS+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE")
ALL_CMAKE_VARS+=("-DCMAKE_VERBOSE_MAKEFILE=ON") ALL_CMAKE_VARS+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
[[ $CI_NO_TEST ]] && ALL_CMAKE_VARS+=("-DPNG_TESTS=OFF")
ALL_CMAKE_VARS+=($CI_CMAKE_VARS) ALL_CMAKE_VARS+=($CI_CMAKE_VARS)
# Build. # Export the CMake build environment.
ci_spawn "$(command -v "$CI_CMAKE")" --version [[ $CI_CMAKE_GENERATOR ]] &&
ci_spawn "$(command -v "$CI_CTEST")" --version ci_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] &&
ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
# Build!
ci_spawn "$CI_CMAKE" -E remove_directory "$CI_BUILDDIR" ci_spawn "$CI_CMAKE" -E remove_directory "$CI_BUILDDIR"
ci_spawn "$CI_CMAKE" -E make_directory "$CI_BUILDDIR" ci_spawn "$CI_CMAKE" -E make_directory "$CI_BUILDDIR"
ci_spawn cd "$CI_BUILDDIR" ci_spawn cd "$CI_BUILDDIR"

View File

@@ -7,13 +7,13 @@ set -e
# Copyright (c) 2019-2020 Cosmin Truta. # Copyright (c) 2019-2020 Cosmin Truta.
# #
# This software is released under the libpng license. # This software is released under the libpng license.
# For conditions of distribution and use, see the disclaimer and license # For conditions of distribution and use, see the disclaimer
# in png.h. # and license in png.h.
CI_SCRIPTNAME="$(basename "$0")" readonly CI_SCRIPTNAME="$(basename "$0")"
CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" readonly CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")" readonly CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")"
CI_BUILDDIR="$CI_SRCDIR" readonly CI_BUILDDIR="$CI_SRCDIR"
function ci_info { function ci_info {
printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*" printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*"
@@ -79,12 +79,12 @@ function ci_build_legacy {
[[ $ALL_LD_FLAGS ]] && ALL_MAKE_ARGS+=("LDFLAGS=$ALL_LD_FLAGS") [[ $ALL_LD_FLAGS ]] && ALL_MAKE_ARGS+=("LDFLAGS=$ALL_LD_FLAGS")
ALL_MAKE_ARGS+=("LIBS=$CI_LIBS") ALL_MAKE_ARGS+=("LIBS=$CI_LIBS")
ALL_MAKE_ARGS+=($CI_MAKE_VARS) ALL_MAKE_ARGS+=($CI_MAKE_VARS)
# Build. # Build!
ci_spawn cd "$CI_SRCDIR" ci_spawn cd "$CI_SRCDIR"
[[ $CI_LEGACY_MAKEFILES ]] || ci_err "bad or missing: \$CI_LEGACY_MAKEFILES"
local MY_MAKEFILE local MY_MAKEFILE
for MY_MAKEFILE in $CI_LEGACY_MAKEFILES for MY_MAKEFILE in $CI_LEGACY_MAKEFILES
do do
ci_info "using makefile: $MY_MAKEFILE"
ci_spawn "$CI_MAKE" "${ALL_MAKE_ARGS[@]}" -f $MY_MAKEFILE ci_spawn "$CI_MAKE" "${ALL_MAKE_ARGS[@]}" -f $MY_MAKEFILE
[[ $CI_NO_TEST ]] || ci_spawn "$CI_MAKE" "${ALL_MAKE_ARGS[@]}" -f $MY_MAKEFILE test [[ $CI_NO_TEST ]] || ci_spawn "$CI_MAKE" "${ALL_MAKE_ARGS[@]}" -f $MY_MAKEFILE test
[[ $CI_NO_CLEAN ]] || ci_spawn "$CI_MAKE" "${ALL_MAKE_ARGS[@]}" -f $MY_MAKEFILE clean [[ $CI_NO_CLEAN ]] || ci_spawn "$CI_MAKE" "${ALL_MAKE_ARGS[@]}" -f $MY_MAKEFILE clean