new ci scripts

This commit is contained in:
BlackMATov
2021-01-15 23:54:11 +07:00
parent 2ee507d832
commit 73ade0af27
26 changed files with 156 additions and 292 deletions

View File

@@ -12,34 +12,17 @@ platform:
- x64
configuration:
- Debug
- Release
for:
-
matrix:
only:
- platform: x86
configuration: Debug
build_script:
- scripts\build_debug_x86.bat
-
matrix:
only:
- platform: x64
configuration: Debug
build_script:
- scripts\build_debug_x64.bat
-
matrix:
only:
- platform: x86
configuration: Release
build_script:
- scripts\build_release_x86.bat
- .ci\builds\build_windows_x86.bat
-
matrix:
@@ -47,7 +30,7 @@ for:
- platform: x64
configuration: Release
build_script:
- scripts\build_release_x64.bat
- .ci\builds\build_windows_x64.bat
before_build:
- git submodule update --init --recursive

21
.ci/builds/build_coverage.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
ROOT_DIR="${DIR}/../.."
BUILD_DIR="${ROOT_DIR}/build/coverage"
mkdir -p "${BUILD_DIR}"
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Debug -DE2D_BUILD_WITH_COVERAGE=ON)
(cd "${BUILD_DIR}" && cmake --build .)
(cd "${BUILD_DIR}" && lcov -d . -z)
(cd "${BUILD_DIR}" && ctest --verbose)
(cd "${BUILD_DIR}" && lcov -d . -c -o "coverage.info")
(cd "${BUILD_DIR}" && lcov -r "coverage.info"\
"*/usr/*" "*/Xcode.app/*" "*/untests/*" "*/samples/*" "*/3rdparty/*" "*/modules/*"\
-o "coverage.info")
(cd "${BUILD_DIR}" && lcov -l "coverage.info")
bash <(curl -s https://codecov.io/bash) -f "${BUILD_DIR}/coverage.info" || echo "Codecov did not collect coverage reports"

11
.ci/builds/build_darwin.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
ROOT_DIR="${DIR}/../.."
BUILD_DIR="${ROOT_DIR}/build/darwin"
mkdir -p "${BUILD_DIR}"
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release)
(cd "${BUILD_DIR}" && cmake --build .)
(cd "${BUILD_DIR}" && ctest --verbose)

11
.ci/builds/build_linux.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
ROOT_DIR="${DIR}/../.."
BUILD_DIR="${ROOT_DIR}/build/linux"
mkdir -p "${BUILD_DIR}"
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release)
(cd "${BUILD_DIR}" && cmake --build .)
(cd "${BUILD_DIR}" && ctest --verbose)

View File

@@ -0,0 +1,19 @@
@echo off
set DIR=%~dp0
set ROOT_DIR=%DIR%..\..\
set BUILD_DIR=%ROOT_DIR%build\windows_x64\
if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error
pushd %BUILD_DIR% || goto :error
cmake %ROOT_DIR% -A x64 || goto :error
cmake --build . --config Release || goto :error
ctest --verbose || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -0,0 +1,19 @@
@echo off
set DIR=%~dp0
set ROOT_DIR=%DIR%..\..\
set BUILD_DIR=%ROOT_DIR%build\windows_x86\
if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error
pushd %BUILD_DIR% || goto :error
cmake %ROOT_DIR% -A Win32 || goto :error
cmake --build . --config Release || goto :error
ctest --verbose || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -0,0 +1,18 @@
@echo off
set DIR=%~dp0
set ROOT_DIR=%DIR%..\..\
set BUILD_DIR=%ROOT_DIR%build\msvc2017_windows\
if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error
pushd %BUILD_DIR% || goto :error
cmake %ROOT_DIR% -G "Visual Studio 15 2017" || goto :error
start enduro2d.sln || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -0,0 +1,18 @@
@echo off
set DIR=%~dp0
set ROOT_DIR=%DIR%..\..\
set BUILD_DIR=%ROOT_DIR%build\msvc2019_windows\
if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error
pushd %BUILD_DIR% || goto :error
cmake %ROOT_DIR% -G "Visual Studio 16 2019" || goto :error
start enduro2d.sln || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

10
.ci/projects/xcode_darwin.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
ROOT_DIR="${DIR}/../.."
BUILD_DIR="${ROOT_DIR}/build/xcode_darwin"
mkdir -p "$BUILD_DIR"
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -G Xcode)
(cd "${BUILD_DIR}" && open "enduro2d.xcodeproj")

View File

@@ -1,19 +0,0 @@
-Iheaders
-Iheaders/3rdparty
-Iheaders/3rdparty/imgui
-Iheaders/3rdparty/pugixml
-Isources
-Isources/3rdparty
-Imodules/defer.hpp/headers
-Imodules/ecs.hpp/headers
-Imodules/enum.hpp/headers
-Imodules/flat.hpp/headers
-Imodules/promise.hpp/headers
-Imodules/glew/include
-Imodules/glfw/include
-std=c++17
-stdlib=libc++

View File

@@ -1,5 +0,0 @@
ignore:
- "untests/*"
- "samples/*"
- "*/3rdparty/*"
- "*/modules/*"

View File

@@ -1,128 +1,70 @@
language: cpp
env:
global:
- E2D_WITHOUT_AUDIO=true
- E2D_WITHOUT_GRAPHICS=true
matrix:
language: cpp
jobs:
include:
#
# linux (g++-7)
# linux (g++)
#
- os: linux
dist: xenial
dist: bionic
stage: linux
name: debug, g++-7
name: g++-7
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-7"] } }
env: CC=gcc-7 CXX=g++-7
script: ./scripts/build_debug.sh
script: .ci/builds/build_linux.sh
- os: linux
dist: xenial
dist: bionic
stage: linux
name: release, g++-7
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-7"] } }
env: CC=gcc-7 CXX=g++-7
script: ./scripts/build_release.sh
#
# linux (g++-8)
#
- os: linux
dist: xenial
stage: linux
name: debug, g++-8
name: g++-8
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-8"] } }
env: CC=gcc-8 CXX=g++-8
script: ./scripts/build_debug.sh
- os: linux
dist: xenial
stage: linux
name: release, g++-8
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-8"] } }
env: CC=gcc-8 CXX=g++-8
script: ./scripts/build_release.sh
script: .ci/builds/build_linux.sh
#
# linux (clang++-5.0)
# linux (clang++)
#
- os: linux
dist: xenial
dist: bionic
stage: linux
name: debug, clang++-5.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-5.0"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-7", "clang-5.0"] } }
name: clang++-5.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "clang-5.0"] } }
env: CC=clang-5.0 CXX=clang++-5.0
script: ./scripts/build_debug.sh
script: .ci/builds/build_linux.sh
- os: linux
dist: xenial
dist: bionic
stage: linux
name: release, clang++-5.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-5.0"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-7", "clang-5.0"] } }
env: CC=clang-5.0 CXX=clang++-5.0
script: ./scripts/build_release.sh
#
# linux (clang++-6.0)
#
- os: linux
dist: xenial
stage: linux
name: debug, clang++-6.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-6.0"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-7", "clang-6.0"] } }
name: clang++-6.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "clang-6.0"] } }
env: CC=clang-6.0 CXX=clang++-6.0
script: ./scripts/build_debug.sh
- os: linux
dist: xenial
stage: linux
name: release, clang++-6.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-6.0"], packages: ["libx11-dev", "libgl1-mesa-dev", "xorg-dev", "g++-7", "clang-6.0"] } }
env: CC=clang-6.0 CXX=clang++-6.0
script: ./scripts/build_release.sh
script: .ci/builds/build_linux.sh
#
# macosx (xcode10)
# darwin
#
- os: osx
osx_image: xcode10
stage: macosx
name: debug, xcode10
stage: darwin
name: xcode10
addons: { homebrew: { packages: ["git-lfs"], update: true } }
script: ./scripts/build_debug.sh
- os: osx
osx_image: xcode10
stage: macosx
name: release, xcode10
addons: { homebrew: { packages: ["git-lfs"], update: true } }
script: ./scripts/build_release.sh
#
# macosx (xcode11)
#
script: .ci/builds/build_darwin.sh
- os: osx
osx_image: xcode11
stage: macosx
name: debug, xcode11
stage: darwin
name: xcode11
addons: { homebrew: { packages: ["git-lfs"], update: true } }
script: ./scripts/build_debug.sh
- os: osx
osx_image: xcode11
stage: macosx
name: release, xcode11
addons: { homebrew: { packages: ["git-lfs"], update: true } }
script: ./scripts/build_release.sh
script: .ci/builds/build_darwin.sh
#
# coverage
@@ -133,15 +75,7 @@ matrix:
stage: coverage
name: coverage, xcode10
addons: { homebrew: { packages: ["git-lfs", "lcov"], update: true } }
script: ./scripts/upload_coverage.sh
before_install:
- if [ "$TRAVIS_OS_NAME" == 'linux' ]; then
mkdir $HOME/cmake;
export PATH="$HOME/cmake/bin:$PATH";
travis_retry wget -q https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.sh;
sh cmake-3.11.4-Linux-x86_64.sh --prefix=$HOME/cmake --exclude-subdir --skip-license;
fi
script: .ci/builds/build_coverage.sh
before_script:
- git submodule update --init --recursive

View File

@@ -1,12 +0,0 @@
@echo off
set SCRIPT_DIR=%~dp0%
call %SCRIPT_DIR%\build_debug_x86.bat || goto :error
call %SCRIPT_DIR%\build_debug_x64.bat || goto :error
call %SCRIPT_DIR%\build_release_x86.bat || goto :error
call %SCRIPT_DIR%\build_release_x64.bat || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,5 +0,0 @@
#!/bin/bash
set -e
SCRIPT_DIR=`dirname "$BASH_SOURCE"`
$SCRIPT_DIR/build_debug.sh
$SCRIPT_DIR/build_release.sh

View File

@@ -1,9 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
rmdir /s /q %BUILD_DIR% || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,4 +0,0 @@
#!/bin/bash
set -e
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
rm -rf $BUILD_DIR

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -e
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
mkdir -p $BUILD_DIR/Debug
pushd $BUILD_DIR/Debug
cmake -DCMAKE_BUILD_TYPE=Debug ../..
cmake --build .
ctest --verbose
popd

View File

@@ -1,14 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
mkdir %BUILD_DIR%\Debug\x64 || goto :error
pushd %BUILD_DIR%\Debug\x64 || goto :error
cmake ..\..\.. -A x64 || goto :error
cmake --build . --config Debug || goto :error
ctest --verbose || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,14 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
mkdir %BUILD_DIR%\Debug\x86 || goto :error
pushd %BUILD_DIR%\Debug\x86 || goto :error
cmake ..\..\.. -A Win32 || goto :error
cmake --build . --config Debug || goto :error
ctest --verbose || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -e
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
mkdir -p $BUILD_DIR/Release
pushd $BUILD_DIR/Release
cmake -DCMAKE_BUILD_TYPE=Release ../..
cmake --build .
ctest --verbose
popd

View File

@@ -1,14 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
mkdir %BUILD_DIR%\Release\x64 || goto :error
pushd %BUILD_DIR%\Release\x64 || goto :error
cmake ..\..\.. -A x64 || goto :error
cmake --build . --config Release || goto :error
ctest --verbose || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,14 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
mkdir %BUILD_DIR%\Release\x86 || goto :error
pushd %BUILD_DIR%\Release\x86 || goto :error
cmake ..\..\.. -A Win32 || goto :error
cmake --build . --config Release || goto :error
ctest --verbose || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,13 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
mkdir %BUILD_DIR%\msvc2017 || goto :error
pushd %BUILD_DIR%\msvc2017 || goto :error
cmake -G "Visual Studio 15 2017" ..\.. || goto :error
start enduro2d.sln || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,13 +0,0 @@
@echo off
set BUILD_DIR=%~dp0%\..\build
mkdir %BUILD_DIR%\msvc2019 || goto :error
pushd %BUILD_DIR%\msvc2019 || goto :error
cmake -G "Visual Studio 16 2019" ..\.. || goto :error
start enduro2d.sln || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

View File

@@ -1,8 +0,0 @@
#!/bin/bash
set -e
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
mkdir -p $BUILD_DIR/xcode
pushd $BUILD_DIR/xcode
cmake -G Xcode ../..
open enduro2d.xcodeproj
popd

View File

@@ -1,18 +0,0 @@
#!/bin/bash
set -e
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
mkdir -p $BUILD_DIR/coverage
pushd $BUILD_DIR/coverage
cmake -DCMAKE_BUILD_TYPE=Debug -DE2D_BUILD_WITH_COVERAGE=ON ../..
cmake --build .
lcov -d . -z
ctest --verbose
lcov -d . -c -o "coverage.info"
lcov -r "coverage.info" "*/usr/*" "*/Xcode.app/*" "*/untests/*" "*/samples/*" "*/3rdparty/*" "*/modules/*" -o "coverage.info"
lcov -l "coverage.info"
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
popd