Merge pull request #1284 from yubiuser/gihtub_CI

Add Github Action CI workflow
This commit is contained in:
bel2125 2024-09-15 10:21:04 +02:00 committed by GitHub
commit 0f958bca7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 528 additions and 522 deletions

522
.github/workflows/cibuild.yml vendored Normal file
View File

@ -0,0 +1,522 @@
name: CI build
on:
push:
pull_request:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
compiler: clang
env:
idx: 1
N: Clang-Linux-Minimal-Debug
BUILD_TYPE: Debug
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: NO
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: YES
ENABLE_SSL: NO
NO_CGI: YES
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_SERVER_STATS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: clang
env:
idx: 3
N: Clang-Linux-Default-Release
BUILD_TYPE: Release
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_SERVER_STATS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: gcc
env:
idx: 5
N: GCC-Linux-Complete-NoLua-Release
BUILD_TYPE: Release
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: YES
ENABLE_WEBSOCKETS: YES
ENABLE_SERVER_STATS: YES
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: YES
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: clang
env:
idx: 6
N: CLANG-AnyVersion-Linux-Coverage
BUILD_TYPE: Coverage
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: YES
ENABLE_WEBSOCKETS: YES
ENABLE_SERVER_STATS: YES
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: clang
env:
idx: 9
N: Clang-Linux-Default-Shared
BUILD_TYPE: Debug
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: NO
OPENSSL_1_1: YES
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: YES
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_SERVER_STATS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: gcc
env:
idx: 15
N: GCCLinuxDefault_RelWithDebInfo
BUILD_TYPE: RelWithDebInfo
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: gcc
env:
idx: 16
N: GCCLinuxDefault_MinSizeRel
BUILD_TYPE: MinSizeRel
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: gcc
env:
idx: 17
N: GCCLinuxDefault_None
BUILD_TYPE: None
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: gcc
env:
idx: 20
N: GCCLinuxDefault_xenial
BUILD_TYPE: Release
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
- os: ubuntu-latest
compiler: gcc
env:
idx: 23
N: GCCLinuxDefault_focal
BUILD_TYPE: Release
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: NO
OPENSSL_1_1: YES
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: NO
ENABLE_WEBSOCKETS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
# Disable Lua build, until someone knows how to fix the CMake files
# see https://github.com/civetweb/civetweb/issues/543
# - os: ubuntu-lastest
# compiler: clang
# env:
# idx: 99
# N: Clang-Linux-Complete-WithLua-Debug
# BUILD_TYPE: Debug
# ENABLE_SSL_DYNAMIC_LOADING: YES
# OPENSSL_1_0: NO
# OPENSSL_1_1: YES
# ENABLE_CXX: NO
# C_STANDARD: auto
# CXX_STANDARD: auto
# BUILD_SHARED: NO
# NO_FILES: NO
# ENABLE_SSL: YES
# NO_CGI: NO
# ENABLE_IPV6: YES
# ENABLE_WEBSOCKETS: YES
# ENABLE_SERVER_STATS: YES
# ENABLE_LUA: YES
# ENABLE_LUA_SHARED: YES
# ENABLE_DUKTAPE: NO
# NO_CACHING: YES
# ALLOW_WARNINGS: YES
# RUN_UNITTEST: 1
- os: macos-latest
compiler: clang
env:
idx: 8
N: Clang-OSX-Complete-NoLua-Release-OpenSSL_1_1_NoDynLoad
BUILD_TYPE: Release
ENABLE_SSL_DYNAMIC_LOADING: NO
OPENSSL_1_0: NO
OPENSSL_1_1: YES
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: YES
ENABLE_WEBSOCKETS: YES
ENABLE_SERVER_STATS: YES
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: YES
ALLOW_WARNINGS: YES
RUN_UNITTEST: 1
# mac-os 13 is the last version of MacOS runner using x86_64 architecture
# mac-os 14 and later are using arm64 architecture
# but OpenSSL 1.0 can't compile on arm64, so we set it fixed to mac-os 13
- os: macos-13
compiler: clang
env:
idx: 11
N: OSX-Package
BUILD_TYPE: Release
ENABLE_SSL_DYNAMIC_LOADING: YES
OPENSSL_1_0: YES
OPENSSL_1_1: NO
ENABLE_CXX: NO
ENABLE_LUA_SHARED: NO
C_STANDARD: auto
CXX_STANDARD: auto
BUILD_SHARED: NO
NO_FILES: NO
ENABLE_SSL: YES
NO_CGI: NO
ENABLE_IPV6: YES
ENABLE_WEBSOCKETS: YES
ENABLE_SERVER_STATS: NO
ENABLE_LUA: NO
ENABLE_DUKTAPE: NO
NO_CACHING: NO
ALLOW_WARNINGS: YES
MACOSX_PACKAGE: 1
RUN_UNITTEST: 1
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
- name: Install clang on Linux
if: matrix.compiler == 'clang' && startsWith(matrix.os,'ubuntu')
run: |
sudo apt-get install --no-install-recommends -y clang
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
- name: Install OpenSSL 1.0 on modern MacOS
# Needed for recent versions of MacOS as they ship with OpenSSL 1.1 by default
if: startsWith(matrix.os,'macos') && matrix.env.OPENSSL_1_0 == 'YES'
run: |
curl -O -L https://openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
tar -xzf openssl-1.0.2u.tar.gz
cd openssl-1.0.2u
./Configure --prefix=/usr/local/ssl1.0 --openssldir=/usr/local/ssl1.0 shared shared darwin64-x86_64-cc
make depend
make -j $(nproc)
sudo make install_sw -j $(nproc)
OPENSSL_ROOT_DIR=/usr/local/ssl1.0
LDFLAGS=-L${OPENSSL_ROOT_DIR}/lib
CFLAGS=-I${OPENSSL_ROOT_DIR}/include
ADDITIONAL_CMAKE_ARGS="-DCMAKE_SHARED_LINKER_FLAGS=${LDFLAGS} -DMAKE_C_FLAGS=${CFLAGS}"
PKG_CONFIG_PATH=${OPENSSL_ROOT_DIR}/lib/pkgconfig
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
echo "CFLAGS=${CFLAGS}" >> $GITHUB_ENV
echo "${OPENSSL_ROOT_DIR}/bin" >> $GITHUB_PATH
echo "ADDITIONAL_CMAKE_ARGS=${ADDITIONAL_CMAKE_ARGS}" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${OPENSSL_ROOT_DIR}/lib" >> $GITHUB_ENV
- name: Set up OpenSSL 1.1 on modern MacOS
# OpenSSL 1.1 is installed by default, so we just need to set the paths
if: startsWith(matrix.os,'macos') && matrix.env.OPENSSL_1_1 == 'YES'
run: |
OPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1)
LDFLAGS=-L${OPENSSL_ROOT_DIR}/lib
CFLAGS=-I${OPENSSL_ROOT_DIR}/include
ADDITIONAL_CMAKE_ARGS="-DCMAKE_SHARED_LINKER_FLAGS=${LDFLAGS} -DMAKE_C_FLAGS=${CFLAGS}"
PKG_CONFIG_PATH=${OPENSSL_ROOT_DIR}/lib/pkgconfig
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
echo "CFLAGS=${CFLAGS}" >> $GITHUB_ENV
echo "${OPENSSL_ROOT_DIR}/bin" >> $GITHUB_PATH
echo "ADDITIONAL_CMAKE_ARGS=${ADDITIONAL_CMAKE_ARGS}" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
- name: Install OpenSSL 1.0 on modern Linux
# Needed for recent versions of Linux as they ship with OpenSSL 3.0 by default
if: startsWith(matrix.os,'ubuntu') && matrix.env.OPENSSL_1_0 == 'YES'
run: |
curl -O -L https://openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
tar -xzf openssl-1.0.2u.tar.gz
cd openssl-1.0.2u
./config --prefix=/usr/local/ssl1.0 --openssldir=/usr/local/ssl1.0 shared
make depend
make -j $(nproc)
sudo make install_sw -j $(nproc)
sudo ldconfig
OPENSSL_ROOT_DIR=/usr/local/ssl1.0
LDFLAGS=-L${OPENSSL_ROOT_DIR}/lib
CFLAGS=-I${OPENSSL_ROOT_DIR}/include
ADDITIONAL_CMAKE_ARGS="-DCMAKE_SHARED_LINKER_FLAGS=${LDFLAGS} -DMAKE_C_FLAGS=${CFLAGS}"
PKG_CONFIG_PATH=${OPENSSL_ROOT_DIR}/lib/pkgconfig
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
echo "CFLAGS=${CFLAGS}" >> $GITHUB_ENV
echo "${OPENSSL_ROOT_DIR}/bin" >> $GITHUB_PATH
echo "ADDITIONAL_CMAKE_ARGS=${ADDITIONAL_CMAKE_ARGS}" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${OPENSSL_ROOT_DIR}/lib" >> $GITHUB_ENV
- name: Install OpenSSL 1.1 on modern Linux
# Needed for recent versions of Linux as they ship with OpenSSL 3.0 by default
if: startsWith(matrix.os,'ubuntu') && matrix.env.OPENSSL_1_1 == 'YES'
run: |
curl -O -L https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
tar -xzf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/usr/local/ssl1.1 --openssldir=/usr/local/ssl1.1 shared
make depend
make -j $(nproc)
sudo make install_sw -j $(nproc)
sudo ldconfig
OPENSSL_ROOT_DIR=/usr/local/ssl1.1
LDFLAGS=-L${OPENSSL_ROOT_DIR}/lib
CFLAGS=-I${OPENSSL_ROOT_DIR}/include
ADDITIONAL_CMAKE_ARGS="-DCMAKE_SHARED_LINKER_FLAGS=${LDFLAGS} -DMAKE_C_FLAGS=${CFLAGS}"
PKG_CONFIG_PATH=${OPENSSL_ROOT_DIR}/lib/pkgconfig
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
echo "CFLAGS=${CFLAGS}" >> $GITHUB_ENV
echo "${OPENSSL_ROOT_DIR}/bin" >> $GITHUB_PATH
echo "ADDITIONAL_CMAKE_ARGS=${ADDITIONAL_CMAKE_ARGS}" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${OPENSSL_ROOT_DIR}/lib" >> $GITHUB_ENV
- name: Print tool version information
run: |
openssl version
cc --version
cmake --version
clang --version
- name: Run CMake
run: |
cmake -S . -B output\
-DCMAKE_BUILD_TYPE=${{ matrix.env.BUILD_TYPE }}\
-DBUILD_SHARED_LIBS=${{ matrix.env.BUILD_SHARED }}\
-DCIVETWEB_THIRD_PARTY_DIR=../src/third-party\
-DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES\
-DCIVETWEB_ENABLE_SSL=${{ matrix.env.ENABLE_SSL }}\
-DCIVETWEB_DISABLE_CGI=${{ matrix.env.NO_CGI }}\
-DCIVETWEB_SERVE_NO_FILES=${{ matrix.env.NO_FILES }}\
-DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=${{ matrix.env.ENABLE_SSL_DYNAMIC_LOADING }}\
-DCIVETWEB_SSL_OPENSSL_API_1_0=${{ matrix.env.OPENSSL_1_0 }}\
-DCIVETWEB_SSL_OPENSSL_API_1_1=${{ matrix.env.OPENSSL_1_1 }}\
-DCIVETWEB_SSL_OPENSSL_API_3_0=${{ matrix.env.OPENSSL_3_0 }}\
-DCIVETWEB_ENABLE_WEBSOCKETS=${{ matrix.env.ENABLE_WEBSOCKETS }}\
-DCIVETWEB_ENABLE_CXX=${{ matrix.env.ENABLE_CXX }}\
-DCIVETWEB_ENABLE_SERVER_STATS=${{ matrix.env.ENABLE_SERVER_STATS }}\
-DCIVETWEB_ENABLE_LUA=${{ matrix.env.ENABLE_LUA }}\
-DCIVETWEB_ENABLE_LUA_SHARED=${{ matrix.env.ENABLE_LUA_SHARED }}\
-DCIVETWEB_ENABLE_DUKTAPE=${{ matrix.env.ENABLE_DUKTAPE }}\
-DCIVETWEB_DISABLE_CACHING=${{ matrix.env.NO_CACHING }}\
-DCIVETWEB_C_STANDARD=${{ matrix.env.C_STANDARD }}\
-DCIVETWEB_CXX_STANDARD=${{ matrix.env.CXX_STANDARD }}\
-DCIVETWEB_ALLOW_WARNINGS=${{ matrix.env.ALLOW_WARNINGS }}\
-DCIVETWEB_ENABLE_IPV6=${{ matrix.env.ENABLE_IPV6 }}\
${{ env.ADDITIONAL_CMAKE_ARGS }}
- name: Build MacOS Package
if: matrix.env.MACOSX_PACKAGE == 1
run: |
make -f Makefile.osx package -j $(nproc)
- name: Build executable
run: |
cmake --build output -- -j $(nproc)
- name: Check executable
run: |
./output/src/civetweb -I
- name: Run unit tests
if: matrix.env.RUN_UNITTEST == 1
run: |
# kill processes that are using port 8084, which is used in the unit tests
# Currently, this affects linux only, where 'mono' is using this port
pid_8084=$(sudo lsof -t -i:8084 || true;)
if [[ -n ${pid_8084} ]]; then
echo "Killing process using port 8084: ${pid_8084}"
sudo kill -9 ${pid_8084}
fi
# Run unit tests
gcc unittest/cgi_test.c -o output/cgi_test.cgi
cd output
CTEST_OUTPUT_ON_FAILURE=1 CK_FORK=yes make all test -j $(nproc)

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ log.out
/CMakeCache.txt
/CMakeFiles
/mingw-builds
/output
#################
## Eclipse

View File

@ -9,60 +9,17 @@ cache:
directories:
- $HOME/third-party
osx_image: xcode9
addons:
apt:
packages:
- cmake
- openssl
- libssl-dev
- gdb
sources:
- kubuntu-backports
before_install:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
mkdir $HOME/usr;
export PATH="$HOME/usr/bin:$PATH";
wget https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.sh --no-check-certificate;
chmod +x cmake-3.7.2-Linux-x86_64.sh;
./cmake-3.7.2-Linux-x86_64.sh --prefix=$HOME/usr --exclude-subdir --skip-license;
fi
- cmake --version
install:
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
PATH=~/.local/bin:${PATH};
pip install --user --upgrade pip;
pip install --user cpp-coveralls;
pip install --user codecov;
pip install --user coverage;
fi
before_script:
# Add an IPv6 config - see the corresponding Travis issue
# https://github.com/travis-ci/travis-ci/issues/8361
- if [ "${ENABLE_IPV6}" == "YES" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
echo "Activating IPv6 on Travis";
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
fi
# Check some settings of the build server (operating system, IPv6 availability, directory)
- uname -a
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
lsb_release -a;
cat /etc/network/interfaces || true;
fi
- ifconfig
- pwd
- ls -la
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
apt-cache search gcc | grep "GNU C compiler";
apt-cache search clang | grep compiler;
fi
- if [[ "${BUILD_TYPE}" == "OSX_OPENSSL_1_1" ]]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl@1.1 ;fi
# Generate the build scripts with CMake
- mkdir output
- openssl version
@ -130,16 +87,7 @@ after_failure:
- if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch; fi
# Modifications due to Travis IPv6 issues:
# https://github.com/travis-ci/travis-ci/issues/8711
# https://github.com/travis-ci/travis-ci/issues/8361
# DCIVETWEB_ENABLE_IPV6=${ENABLE_IPV6} or =NO
script:
- if [ "${MACOSX_PACKAGE}" == "1" ]; then
cd "${TRAVIS_BUILD_DIR}";
make -f Makefile.osx package;
fi
- if [ "${RUN_UNITTEST}" == "1" ]; then
CTEST_OUTPUT_ON_FAILURE=1 CK_FORK=yes make all test;
fi
@ -152,16 +100,7 @@ script:
fi
- echo "Build and test script DONE"
# Coveralls options: https://github.com/eddyxu/cpp-coveralls/blob/master/README.md
after_success:
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
echo "Preparing coverage tests";
echo "Creating coveralls coverage report";
coveralls --include src --exclude src/main.c --exclude src/third_party --include include --gcov-options '\-lp' --root .. --build-root .;
echo "Creating codecov coverage report";
bash <(curl -s https://codecov.io/bash);
echo "All coverage reports created";
fi
#########################################################################################
@ -173,350 +112,6 @@ after_success:
matrix:
fast_finish: true
include:
#########################################################################################
##### TRUSTY ########################################################################
#########################################################################################
- dist: trusty
sudo: false
os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env:
idx=1
N=Clang3.8-Linux-Minimal-Debug
MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
BUILD_TYPE=Debug
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=NO
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=YES
ENABLE_SSL=NO
NO_CGI=YES
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_SERVER_STATS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
- dist: trusty
sudo: false
os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env:
idx=3
N=Clang3.8-Linux-Default-Release
MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_SERVER_STATS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
- dist: trusty
sudo: required
os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
idx=5
N=GCC5-Linux-Complete-NoLua-Release
MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=YES
ENABLE_WEBSOCKETS=YES
ENABLE_SERVER_STATS=YES
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=YES
ALLOW_WARNINGS=YES
RUN_UNITTEST=1
#########################################################################################
##### COVERAGE ######################################################################
#########################################################################################
- os: linux
sudo: required
compiler: clang
env:
idx=6
N=GCCAnyVersion-Linux-Coverage
BUILD_TYPE=Coverage
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=YES
ENABLE_WEBSOCKETS=YES
ENABLE_SERVER_STATS=YES
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
RUN_UNITTEST=1
#########################################################################################
##### SHARED ########################################################################
#########################################################################################
- sudo: false
os: linux
compiler: clang
env:
idx=9
N=Clang-Linux-Default-Shared
BUILD_TYPE=Debug
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=NO
OPENSSL_1_1=YES
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=YES
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_SERVER_STATS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
#########################################################################################
##### BUILD TYPES ###################################################################
#########################################################################################
# According to CMakeLists, options are:
# None Debug Release RelWithDebInfo MinSizeRel Coverage
-
os: linux
compiler: gcc
env:
idx=15
N=GCCLinuxDefault_RelWithDebInfo
BUILD_TYPE=RelWithDebInfo
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
-
os: linux
compiler: gcc
env:
idx=16
N=GCCLinuxDefault_MinSizeRel
BUILD_TYPE=MinSizeRel
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
-
os: linux
compiler: gcc
env:
idx=17
N=GCCLinuxDefault_None
BUILD_TYPE=None
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
#########################################################################################
##### XENIAL, BIONIC, FOCAL #########################################################
#########################################################################################
-
os: linux
compiler: gcc
dist: xenial
env:
idx=20
N=GCCLinuxDefault_xenial
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
-
os: linux
compiler: gcc
dist: bionic
env:
idx=21
N=GCCLinuxDefault_bionic
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=NO
OPENSSL_1_1=YES
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
-
os: linux
compiler: gcc
dist: focal
addons:
apt:
packages:
- lsb-core
env:
idx=23
N=GCCLinuxDefault_focal
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=NO
OPENSSL_1_1=YES
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=NO
ENABLE_WEBSOCKETS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
RUN_UNITTEST=1
#########################################################################################
##### FREEBSD BUILD ###########=#####################################################
#########################################################################################
@ -547,116 +142,4 @@ matrix:
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
RUN_UNITTEST=1
#########################################################################################
##### OSX BUILD #####################################################################
#########################################################################################
-
os: osx
sudo: required
compiler: clang
env:
idx=8
N=Clang-OSX-Complete-NoLua-Release-OpenSSL_1_1_NoDynLoad
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=NO
OPENSSL_1_0=NO
OPENSSL_1_1=YES
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=YES
ENABLE_WEBSOCKETS=YES
ENABLE_SERVER_STATS=YES
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=YES
ALLOW_WARNINGS=YES
OPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1"
LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib"
CFLAGS="-I${OPENSSL_ROOT_DIR}/include"
ADDITIONAL_CMAKE_ARGS="-DCMAKE_SHARED_LINKER_FLAGS=${LDFLAGS} -DCMAKE_C_FLAGS=${CFLAGS}"
PATH="${OPENSSL_ROOT_DIR}/bin:$PATH"
DYLD_LIBRARY_PATH="${OPENSSL_ROOT_DIR}/lib:${DYLD_LIBRARY_PATH}"
RUN_UNITTEST=1
-
os: osx
sudo: required
compiler: clang
env:
idx=11
N=OSX-Package
BUILD_TYPE=Release
ENABLE_SSL_DYNAMIC_LOADING=YES
OPENSSL_1_0=YES
OPENSSL_1_1=NO
ENABLE_CXX=NO
ENABLE_LUA_SHARED=NO
C_STANDARD=auto
CXX_STANDARD=auto
BUILD_SHARED=NO
NO_FILES=NO
ENABLE_SSL=YES
NO_CGI=NO
ENABLE_IPV6=YES
ENABLE_WEBSOCKETS=YES
ENABLE_SERVER_STATS=NO
ENABLE_LUA=NO
ENABLE_DUKTAPE=NO
NO_CACHING=NO
ALLOW_WARNINGS=YES
MACOSX_PACKAGE=1
#########################################################################################
#########################################################################################
##### END OF BUILD MATRIX ###########################################################
#########################################################################################
#########################################################################################
# Remove Lua build, until someone knows how to fix the CMake files
#
# - dist: trusty
# sudo: required
# os: linux
# compiler: clang
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.8
# packages:
# - clang-3.8
# - lua5.2
# env:
# idx=99
# N=Clang3.8-Linux-Complete-WithLua-Debug
# MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
# BUILD_TYPE=Debug
# ENABLE_SSL_DYNAMIC_LOADING=YES
# OPENSSL_1_0=NO
# OPENSSL_1_1=YES
# ENABLE_CXX=NO
# ENABLE_LUA_SHARED=YES
# C_STANDARD=auto
# CXX_STANDARD=auto
# BUILD_SHARED=NO
# NO_FILES=NO
# ENABLE_SSL=YES
# NO_CGI=NO
# ENABLE_IPV6=YES
# ENABLE_WEBSOCKETS=YES
# ENABLE_SERVER_STATS=YES
# ENABLE_LUA=YES
# ENABLE_LUA_SHARED=YES
# ENABLE_DUKTAPE=NO
# NO_CACHING=YES
# ALLOW_WARNINGS=YES
RUN_UNITTEST=1

View File

@ -188,7 +188,7 @@ if (CIVETWEB_ENABLE_LUA)
mark_as_advanced(CIVETWEB_LUA_SQLITE_VERSION)
# Lua SQLite Verification Hash
set(CIVETWEB_LUA_SQLITE_MD5_HASH 43234ae08197dfce6da02482ed14ec92 CACHE STRING
set(CIVETWEB_LUA_SQLITE_MD5_HASH ff7abd4aa8bd549eb18298fb954612f8 CACHE STRING
"The hash of Lua SQLite archive to be downloaded")
set_property(CACHE CIVETWEB_LUA_SQLITE_MD5_HASH PROPERTY VALUE ${CIVETWEB_LUA_SQLITE_MD5_HASH})
mark_as_advanced(CIVETWEB_LUA_SQLITE_MD5_HASH)

View File

@ -13,7 +13,7 @@ WITH_LUA = 1
PACKAGE = Civetweb
BUILD_DIR = out
CFLAGS += -DUSE_COCOA -DENABLE_CREATE_CONFIG_FILE -mmacosx-version-min=10.4 -ObjC -arch i386 -arch x86_64
CFLAGS += -DUSE_COCOA -DENABLE_CREATE_CONFIG_FILE -mmacosx-version-min=10.6 -ObjC -arch x86_64 -arch arm64
LDFLAGS += -framework Cocoa
DMG_DIR = $(BUILD_DIR)/dmg

View File

@ -41,7 +41,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreserved-id-macro"
#endif
#if !defined(_XOPEN_SOURCE)
#if !defined(_XOPEN_SOURCE) && !defined(USE_COCOA)
#define _XOPEN_SOURCE 600 /* For PATH_MAX on linux */
/* This should also be sufficient for "realpath", according to
* http://man7.org/linux/man-pages/man3/realpath.3.html, but in

View File

@ -1316,7 +1316,7 @@ START_TEST(test_request_handlers)
char cmd_buf[1024];
char *cgi_env_opt;
const char *server_host = "localhost"; //"test.domain";
const char *server_host = "test.domain";
mark_point();