Newer
Older
# global variables
variables:
GIT_DEPTH: "1"
.linux_build: &linux_build
stage: build
artifacts:
paths:
- build/installer/BornAgain*.sh
- build/py/wheel/manylinux/*.whl
expire_in: 3 days
- export CC=gcc; export CXX=g++
- export CHECK_FLAGS="-DZERO_TOLERANCE=ON -DDEVELOPER_CHECKS=ON"
- export MPLBACKEND=Agg
- QTCMAKE="/usr/local/Qt6/6.2.3/gcc_64/lib/cmake"
# NOTE: CMake's Ninja generator should not be used with CMake < 3.26 due to internal bugs.
- time cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_PREFIX_PATH="$QTCMAKE" -DBA_PY_PACK=ON $CHECK_FLAGS
- time ctest -j16 --output-on-failure
.compile_dependency: &compile_dependency
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- make -j4
- ctest
- make install
.debian_oldstable_py311: &debian_oldstable
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- export CC=gcc; export CXX=g++
- export MPLBACKEND=Agg
- ldd --version
- cmake --version
- eval "$(pyenv init -)"
debian_oldstable_py311:
<<: *debian_oldstable
before_script:
- pyenv global 3.11
debian_oldstable_py310:
<<: *debian_oldstable
before_script:
- pyenv global 3.10
debian_oldstable_py39:
<<: *debian_oldstable
before_script:
- pyenv global 3.9
debian_oldstable_py38:
<<: *debian_oldstable
before_script:
- pyenv global 3.8
versiondocs:
rules:
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
tags:
- www
stage: build
script:
- hugo version
- mkdir build
- cd build
- time cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBA_GUI=OFF
- time ninja -j8
- time ninja -j8 webdoc
- NPROC=12 # number of logical CPUs obtained from `sysctl hw.logicalcpu`
- BREWDIR="/opt/homebrew-x86"
- QTDIR="$BREWDIR/Cellar/qt/6.6.0"
- PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
- OPTDIR="/Users/Shared/Software/scg"
- >
cmake .. -DCMAKE_PREFIX_PATH="$OPTDIR;$QTDIR/lib/cmake;$BREWDIR" -DCMAKE_BUILD_TYPE=Release
-DPython3_ROOT_DIR="$PYPLAT" -DCMAKE_CXX_COMPILER_LAUNCHER="$CCACHE" -DBA_APPLE_BUNDLE=ON
-DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DBA_PY_PACK=ON -DZERO_TOLERANCE=ON
- make -j$NPROC
- ctest -j3 --output-on-failure
artifacts: &mac_artifacts
paths:
- build/installer/*.dmg
# mac_arm:
# tags:
# - mac_arm
# stage: build
# before_script:
# - NPROC=14 # number of logical CPUs obtained from `sysctl hw.logicalcpu`
# - BREWDIR="/opt/homebrew"
# - QTDIR="$BREWDIR/opt/qt"
# - PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
# script: *mac_script
# artifacts: *mac_artifacts
# To test the GitLab process _locally_ on MS-Windows with powershell (pwsh),
# go to the root Git directory, and run:
# C:\GitLab-Runner\gitlab-runner.exe exec shell --shell pwsh --builds-dir <gitlab build-dir> <job-name>
windows:
tags:
- Windows
stage: build
cache:
# key: build-cache
# paths:
# - build/
script:
- $OPT_DIR = "C:/opt/x64"
- $BOOST_DIR = "$OPT_DIR/boost_current"
- $QT_MSVC_DIR = "C:/Qt/6.2.4/msvc2019_64"
- $QTCMake_DIR = "$QT_MSVC_DIR/lib/cmake"
- $PY_PLATFORM_DIR = "C:/Users/admin/.pyenv/pyenv-win/versions/3.11.5/"
- $BUILD_DIR = "build"
# list powershell properties
- echo "# Path '<$Env:Path>'"
- echo "# PythonPath '<$Env:PYTHONPATH>'"
- echo "# Powershell <$PSHOME>`n PS Profile <$PROFILE>`n PS Command-Path <$PSCOMMANDPATH>"
# Visual Studio path <https://github.com/microsoft/vswhere/wiki/Find-VC>
- >
$vsPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
-latest -products *
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationpath
- echo "Microsoft Visual Studio path = '$vsPath'"
- >
Import-Module
(Get-ChildItem $vsPath -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName
- Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64'
- Set-Item -Path "env:CC" -Value "cl.exe"
- Set-Item -Path "env:CXX" -Value "cl.exe"
# list all environmental variables
- 'dir Env:'
# make the CMake build directory
- if($CI_PIPELINE_SOURCE -eq "schedule") { mkdir -Force $BUILD_DIR; echo "scheduled build" }
- if(!(Test-Path -path $BUILD_DIR)) { mkdir -Force $BUILD_DIR; echo "build from scratch" }
- cd $BUILD_DIR
- Remove-Item CM* -Recurse
- pwd
# configure, make, test, pack
- cmake --version
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release
-DPython3_ROOT_DIR="$PY_PLATFORM_DIR" -DBA_PY_PACK=ON
-DCPACK_IFW_ROOT="C:/Qt/Tools/QtInstallerFramework/4.5"
-DCMAKE_C_COMPILER_LAUNCHER="buildcache.exe"
-DCMAKE_CXX_COMPILER_LAUNCHER="buildcache.exe"
- >
if($CI_PIPELINE_SOURCE -eq "schedule")
{ cmake --build . --target clean; echo "redundant target purge done" }
- cmake --build . -j20 --config Release
- cmake --build . --config Release --target ba_wheel
$env:PYTHONPATH += "$CI_PROJECT_DIR/build/lib";
$env:PATH = "$QT_MSVC_DIR/bin;$env:PATH";
ctest -C Release --parallel 20 --output-on-failure