Skip to content
Snippets Groups Projects
Commit 17f248fd authored by Lars Bilke's avatar Lars Bilke
Browse files

[ci] CMake presets on Linux jobs.

parent 669859a8
No related branches found
No related tags found
No related merge requests found
...@@ -7,13 +7,20 @@ ...@@ -7,13 +7,20 @@
}, },
"configurePresets": [ "configurePresets": [
{ {
"name": "release", "name": "_ninja_release",
"hidden": true,
"displayName": "Default Config (Release)", "displayName": "Default Config (Release)",
"description": "Default build using the Ninja generator", "description": "Default build using the Ninja generator",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}", "binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "release",
"inherits": "_ninja_release",
"cacheVariables": {
"OGS_BUILD_UTILS": "ON", "OGS_BUILD_UTILS": "ON",
"OGS_USE_PYTHON": "ON" "OGS_USE_PYTHON": "ON"
} }
...@@ -35,6 +42,14 @@ ...@@ -35,6 +42,14 @@
"OGS_BUILD_GUI": "ON", "OGS_BUILD_GUI": "ON",
"OGS_USE_NETCDF": "ON" "OGS_USE_NETCDF": "ON"
} }
},
{
"name": "ci-simplest",
"inherits": "_ninja_release",
"cacheVariables": {
"OGS_USE_CONAN": "OFF",
"OGS_DISABLE_POETRY": "ON"
}
} }
] ]
} }
...@@ -9,17 +9,12 @@ ...@@ -9,17 +9,12 @@
before_script: before_script:
- "echo \"For debugging run: docker run --rm -it -v $CI_BUILDS_DIR:/builds -w=$CI_PROJECT_DIR $CI_JOB_IMAGE\"" - "echo \"For debugging run: docker run --rm -it -v $CI_BUILDS_DIR:/builds -w=$CI_PROJECT_DIR $CI_JOB_IMAGE\""
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR
- ([ "${CONAN_USER_HOME}" == "${CI_PROJECT_DIR}/.conan" ]) && conan remove --system-reqs '*' - ([ "${CONAN_USER_HOME}" == "${CI_PROJECT_DIR}/.conan" ]) && conan remove --system-reqs '*'
- ([[ $BUILD_CTEST_LARGE_ON_MASTER && "${CI_COMMIT_BRANCH}" == "master" && "${CMAKE_ARGS}" == *"USE_PYTHON=ON"* ]]) && export BUILD_CTEST_LARGE=true - ([[ $BUILD_CTEST_LARGE_ON_MASTER && "${CI_COMMIT_BRANCH}" == "master" && "${CMAKE_ARGS}" == *"USE_PYTHON=ON"* ]]) && export BUILD_CTEST_LARGE=true
script: script:
- "echo \"Running: cmake .. -G Ninja $CMAKE_ARGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOGS_BUILD_PROCESSES=$BUILD_PROCESSES\"" - cmake -S . --preset=$CMAKE_PRESET $CMAKE_ARGS -DOGS_BUILD_PROCESSES=$BUILD_PROCESSES
- > - build_dir=${BUILD_DIR:-build/$CMAKE_PRESET}
cmake .. -G Ninja - cd $build_dir
$CMAKE_ARGS
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DOGS_BUILD_PROCESSES=$BUILD_PROCESSES
- $BUILD_CMD_PREFIX cmake --build . --target package > >(tee make.output) - $BUILD_CMD_PREFIX cmake --build . --target package > >(tee make.output)
- if [ "$BUILD_TESTS" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target tests ; fi - if [ "$BUILD_TESTS" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target tests ; fi
- if [ "$BUILD_CTEST" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target ctest ; fi - if [ "$BUILD_CTEST" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target ctest ; fi
......
.test-artifacts: .test-artifacts:
artifacts: artifacts:
paths: paths:
- $BUILD_DIR/Tests/ctest.xml - build/*/Tests/ctest.xml
- $BUILD_DIR/Tests/testrunner.xml - build/*/Tests/testrunner.xml
- $BUILD_DIR/make.output - build/*/make.output
- $BUILD_DIR/*.zip - build/*/*.zip
- $BUILD_DIR/*.tar.gz - build/*/*.tar.gz
expire_in: 1 week expire_in: 1 week
reports: reports:
junit: junit:
- $BUILD_DIR/Tests/testrunner.xml - build/*/Tests/testrunner.xml
...@@ -10,11 +10,7 @@ build gui linux: ...@@ -10,11 +10,7 @@ build gui linux:
- when: manual - when: manual
allow_failure: true allow_failure: true
variables: variables:
BUILD_DIR: "build-gui-linux" CMAKE_PRESET: release-gui
CMAKE_ARGS: >- CMAKE_ARGS: >-
-DOGS_USE_CONAN=OFF -DOGS_USE_CONAN=OFF
-DOGS_BUILD_CLI=OFF
-DOGS_BUILD_GUI=ON
-DOGS_BUILD_UTILS=ON
-DOGS_USE_NETCDF=ON
-DOGS_INSTALL_DEPENDENCIES=ON -DOGS_INSTALL_DEPENDENCIES=ON
...@@ -4,10 +4,9 @@ build linux conan: ...@@ -4,10 +4,9 @@ build linux conan:
- .rules-master-manual - .rules-master-manual
tags: [shell, envinf1-shell] tags: [shell, envinf1-shell]
variables: variables:
BUILD_DIR: build CMAKE_PRESET: release
CMAKE_ARGS: >- CMAKE_ARGS: >-
-DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=ON
-DOGS_BUILD_UTILS=ON
-DOGS_USE_CONAN=AUTO -DOGS_USE_CONAN=AUTO
-DOGS_USE_MFRONT=ON -DOGS_USE_MFRONT=ON
-DOGS_USE_XDMF=ON -DOGS_USE_XDMF=ON
...@@ -6,10 +6,8 @@ build linux frontend: ...@@ -6,10 +6,8 @@ build linux frontend:
- frontend2 - frontend2
allow_failure: true allow_failure: true
variables: variables:
BUILD_DIR: "build"
CCACHE_DIR: "/data/ogs/.ccache" CCACHE_DIR: "/data/ogs/.ccache"
CMAKE_ARGS: "-DOGS_USE_CONAN=OFF -DOGS_DISABLE_CCACHE=OFF -DOGS_CPU_ARCHITECTURE=generic" CMAKE_PRESET: release
CMAKE_ARGS: "-DOGS_USE_CONAN=OFF -DOGS_USE_PYTHON=OFF -DOGS_CPU_ARCHITECTURE=generic"
before_script: before_script:
- source scripts/env/eve/cli.sh - source scripts/env/eve/cli.sh
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR
...@@ -4,10 +4,9 @@ build linux: ...@@ -4,10 +4,9 @@ build linux:
tags: [ docker ] tags: [ docker ]
timeout: 2h timeout: 2h
variables: variables:
BUILD_DIR: "build"
BUILD_CTEST_LARGE_ON_MASTER: "true" BUILD_CTEST_LARGE_ON_MASTER: "true"
CMAKE_PRESET: release
CMAKE_ARGS: >- CMAKE_ARGS: >-
-DOGS_BUILD_UTILS=ON
-DOGS_USE_CONAN=OFF -DOGS_USE_CONAN=OFF
-DOGS_USE_MFRONT=ON -DOGS_USE_MFRONT=ON
-DOGS_$USE_PYTHON -DOGS_$USE_PYTHON
...@@ -24,16 +23,16 @@ build linux (no unity): ...@@ -24,16 +23,16 @@ build linux (no unity):
tags: [ docker ] tags: [ docker ]
timeout: 1h timeout: 1h
variables: variables:
BUILD_DIR: "build-no-unity" BUILD_DIR: "build/no-unity"
BUILD_TESTS: "false" BUILD_TESTS: "false"
BUILD_CTEST: "false" BUILD_CTEST: "false"
CMAKE_PRESET: release
CMAKE_ARGS: >- CMAKE_ARGS: >-
-DOGS_BUILD_UTILS=ON
-DOGS_USE_CONAN=OFF -DOGS_USE_CONAN=OFF
-DOGS_USE_UNITY_BUILDS=OFF
-DOGS_USE_MFRONT=ON -DOGS_USE_MFRONT=ON
-DOGS_USE_UNITY_BUILDS=OFF
-DOGS_USE_XDMF=ON -DOGS_USE_XDMF=ON
-DOGS_USE_PYTHON=ON -B $BUILD_DIR
build linux (no deps, no procs): build linux (no deps, no procs):
image: $CONTAINER_GCC_IMAGE image: $CONTAINER_GCC_IMAGE
...@@ -41,9 +40,7 @@ build linux (no deps, no procs): ...@@ -41,9 +40,7 @@ build linux (no deps, no procs):
tags: [ docker ] tags: [ docker ]
timeout: 1h timeout: 1h
variables: variables:
BUILD_DIR: "build-no-unity"
BUILD_TESTS: "false" BUILD_TESTS: "false"
BUILD_CTEST: "false" BUILD_CTEST: "false"
BUILD_PROCESSES: "SteadyStateDiffusion" BUILD_PROCESSES: "SteadyStateDiffusion"
CMAKE_ARGS: >- CMAKE_PRESET: ci-simplest
-DOGS_USE_CONAN=OFF
...@@ -8,10 +8,9 @@ fi ...@@ -8,10 +8,9 @@ fi
module use /global/apps/modulefiles module use /global/apps/modulefiles
module load foss/2019b module load foss/2019b
module load CMake/3.15.3 module load cmake/3.19.4-1
module load ninja module load ninja
module load git/2.23.0 module load git/2.23.0
module load git-lfs/2.7.1
# Libraries # Libraries
module load boost/1.67.0-1 module load boost/1.67.0-1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment