Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitLab CI config #2968

Merged
merged 56 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ac31f70
[ci] Test includes.
bilke Jan 31, 2020
3c7ca22
[ci] Added build_image job.
bilke Jan 31, 2020
671072a
[ci] Use gitlab container registry.
bilke Feb 10, 2020
6f27549
[ci] Added testrunner report.
bilke Feb 11, 2020
3220daa
[ci] Added compiler warnings job.
bilke Feb 13, 2020
c3898ee
[ci] build: Removed conan references.
bilke Feb 13, 2020
c7448f4
[ci] Added xunit to junit conversion for ctest results.
bilke Feb 13, 2020
9647942
[ci] Added build docs job.
bilke Feb 13, 2020
a74fab9
[ci] Added win build
bilke Feb 18, 2020
75a8ef0
[ci] Added pre-commit and git diff check.
bilke Feb 18, 2020
c2aaf10
[ci] Disable git lfs when not needed.
bilke Feb 18, 2020
5a2bacd
[ci] Build gui on Windows.
bilke Feb 18, 2020
ed1e448
[ci] Removed entrypoint.
bilke Feb 18, 2020
a0e8508
[ci] Added gui stage.
bilke Feb 18, 2020
e6538eb
[ci] Trigger win gui job manually.
bilke Feb 18, 2020
9abe160
[CMake] Added option OGS_CI_TESTRUNNER_REPEAT.
bilke Feb 19, 2020
cb3b7f7
[ci] Added win compiler warnings check.
bilke Feb 19, 2020
f359e1e
[ci] Added mac build.
bilke Feb 19, 2020
5f6c825
[ci] Moved build-docs to its own file.
bilke Feb 20, 2020
e55594d
[ci] Use build job template.
bilke Feb 20, 2020
f89cfc7
[ci] Use extends template for win jobs.
bilke Feb 20, 2020
bf7be8c
[ci] Set default options in top-level yml.
bilke Feb 20, 2020
fb18772
[ci] Added defaults template which disables artifacts passing.
bilke Feb 20, 2020
8dab960
[ci] Fixed powershell variable explansion
bilke Feb 20, 2020
53ebbfa
[ci] Added linux gui job.
bilke Feb 20, 2020
5b9b3f4
[ci] Added mac gui build.
bilke Feb 20, 2020
6211aa2
[ci] Consistent naming.
bilke Feb 21, 2020
414dacb
[ci] Added template for building Dockerfiles.
bilke Feb 21, 2020
83af064
[ci] Trigger Gui builds on DataExplorer change.
bilke Feb 27, 2020
a92376a
[ci] Use needs: keyword for DAG.
bilke Feb 27, 2020
5626d5c
[CI] Changed to rules syntax.
bilke May 18, 2020
1732de1
[CI] Build helper docker images on master only.
bilke May 18, 2020
333ea59
[CI] Added ogs tag to use specific runners.
bilke May 18, 2020
e70d519
[CI] Added workflow:rules.
bilke May 18, 2020
bd8caaf
[CI] Added artifact expiration.
bilke May 19, 2020
6321c12
[T] Fixed NetCDF_Image_Test.
bilke May 20, 2020
e36a3c5
[CI] Migrated xunit2junit from Singularity to Docker.
bilke May 20, 2020
b86fe98
[CI] Added frontend1 job.
bilke May 27, 2020
b47a527
[CI] Added petsc job on envinf1.
bilke May 27, 2020
9bb6a0b
[CI] Use merge request workflow template.
bilke May 27, 2020
5cede9a
[T] Fix testrunner argument.
bilke May 27, 2020
8074d88
[CI] Ensure lfs setup.
bilke May 27, 2020
d1e7385
[CI] Use ogs group registry.
bilke May 28, 2020
450559e
[CI] Added check-header job.
bilke May 28, 2020
c93230d
[CI] Fix runner tags
bilke May 28, 2020
bf0d29a
[CI] container setup fix.
bilke May 28, 2020
8d19542
[CMake] Check header fix for non-existing targets.
bilke May 28, 2020
00ec780
[CI] Added tests-large job.
bilke May 28, 2020
ff4e2ab
[CI] Added web url-checker job.
bilke May 28, 2020
23023dc
[CI] Added clang sanitizer job.
bilke May 28, 2020
5657731
[CI] Added clang-tidy job.
bilke May 28, 2020
3edb399
[CI] Fix caching.
bilke May 28, 2020
450c9ab
[CMake] Removed parallel option for ctest targets.
bilke Jun 2, 2020
fb29d74
Updated submodule container-maker.
bilke Jun 2, 2020
bbb1c84
[CI] Run heavy linux builds on envinf1.
bilke Jun 2, 2020
bd751d4
[CMake] Added clcache (win) integration.
bilke Jun 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 47 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,49 @@
stages:
- pre-checks
- build
- checks
- gui
- package


variables:
GIT_STRATEGY: fetch
OPENMPI_VERSIONS: 'off 2.1.6 3.1.4 4.0.1'
# Docker image names
CONTAINER_GCC_IMAGE: $CI_REGISTRY/ogs/$CI_PROJECT_NAME/$CI_PROJECT_NAMESPACE/gcc:$CI_COMMIT_REF_SLUG
CONTAINER_GCC_GUI_IMAGE: $CI_REGISTRY/ogs/$CI_PROJECT_NAME/$CI_PROJECT_NAMESPACE/gcc-gui:$CI_COMMIT_REF_SLUG
CONTAINER_CLANG_IMAGE: $CI_REGISTRY/ogs/$CI_PROJECT_NAME/$CI_PROJECT_NAMESPACE/clang:$CI_COMMIT_REF_SLUG
XUNIT_TO_JUNIT_IMAGE: $CI_REGISTRY/ogs/$CI_PROJECT_NAME/xunit-to-junit
PRECOMMIT_IMAGE: $CI_REGISTRY/ogs/$CI_PROJECT_NAME/pre-commit
WEB_IMAGE: $CI_REGISTRY/ogs/$CI_PROJECT_NAME/web
# Build config
BUILD_TYPE: Release
BUILD_PROCESSES: "" # Empty string: builds all processes

build-container:
tags:
- docker-shell
stage: build
script:
- git submodule update --init ThirdParty/container-maker
- virtualenv .venv
- source .venv/bin/activate
- pip install -r ThirdParty/container-maker/requirements.txt
- export PYTHONPATH="${PYTHONPATH}:${PWD}/ThirdParty/container-maker"
- python ThirdParty/container-maker/ogscm/cli.py -B -C -R --ogs . --pm system --cvode --ompi $OPENMPI_VERSIONS
artifacts:
paths:
- _out/images/*.sif
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
# extends
- local: '/scripts/ci/extends/defaults.yml'
- local: '/scripts/ci/extends/rules-master-manual.yml'
- local: '/scripts/ci/extends/template-build-linux.yml'
- local: '/scripts/ci/extends/template-build-win.yml'
- local: '/scripts/ci/extends/container-maker-setup.yml'
- local: '/scripts/ci/extends/vs2019-environment.yml'
- local: '/scripts/ci/extends/test-artifacts.yml'
# jobs
- local: '/scripts/ci/jobs/pre-commit.yml'
- local: '/scripts/ci/jobs/build_image.yml'
- local: '/scripts/ci/jobs/build-linux.yml'
- local: '/scripts/ci/jobs/build-linux-petsc.yml'
- local: '/scripts/ci/jobs/build-linux-frontend.yml'
- local: '/scripts/ci/jobs/build-docs.yml'
- local: '/scripts/ci/jobs/build-win.yml'
- local: '/scripts/ci/jobs/build-mac.yml'
- local: '/scripts/ci/jobs/checks.yml'
- local: '/scripts/ci/jobs/container.yml'
- local: '/scripts/ci/jobs/build-gui-linux.yml'
- local: '/scripts/ci/jobs/build-gui-win.yml'
- local: '/scripts/ci/jobs/build-gui-mac.yml'
- local: '/scripts/ci/jobs/check-header.yml'
- local: '/scripts/ci/jobs/tests-large.yml'
- local: '/scripts/ci/jobs/web.yml'
- local: '/scripts/ci/jobs/clang-sanitizer.yml'
- local: '/scripts/ci/jobs/clang-tidy.yml'
3 changes: 1 addition & 2 deletions Applications/Utils/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ if(OGS_USE_NETCDF)
EXECUTABLE_ARGS -i sresa1b_ncar_ccsm3-example.nc -o ${Data_BINARY_DIR}/FileConverter/sresa1b_ncar_ccsm3-example.asc -v pr -t 0 --dim1 2 --dim2 1 --timestep-first 0 --timestep-last 0 --images
REQUIREMENTS NOT OGS_USE_MPI
TESTER diff
DIFF_DATA
sresa1b_ncar_ccsm3-example.asc
DIFF_DATA sresa1b_ncar_ccsm3-example0.asc
)
endif()

Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ option(OGS_ENABLE_AVX2 "Enable the use of AVX2 instructions" OFF)
option(OGS_USE_CONAN "Should Conan package manager be used?" ON)
set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \
never or list of libs to build")
option(OGS_DISABLE_CCACHE "Disables ccache compiler cache." OFF)
if(WIN32)
option(OGS_DISABLE_CLCACHE "Disables clcache compiler cache." OFF)
else()
option(OGS_DISABLE_CCACHE "Disables ccache compiler cache." OFF)
endif()
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.16)
option(OGS_USE_UNITY_BUILDS "Enables Unity builds for faster compilation." ON)
endif()
Expand Down Expand Up @@ -69,6 +73,7 @@ include(ConanSetup)
include(CompilerSetup)
include(Find)
include(CCacheSetup)
include(CLCacheSetup)
include(DocumentationSetup)
include(test/Test)
if(OGS_COVERAGE AND NOT IS_SUBPROJECT)
Expand Down
2 changes: 0 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ pipeline {
MSVC_NUMBER = '16'
MSVC_VERSION = '2019'
OMP_NUM_THREADS = '1'
CC = 'clcache'
CXX = 'clcache'
}
steps {
script {
Expand Down
1 change: 0 additions & 1 deletion MaterialLib/SolidModels/MFront/DruckerPrager.mfront
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ lam.setGlossaryName("EquivalentPlasticStrain");
dflam_ddeel = theta * (nF | D) / D(0, 0);
}
}

4 changes: 3 additions & 1 deletion Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ endif()
# cmake-format: off
# Add make-target tests which runs the testrunner
if(IS_CI AND NOT OGS_COVERAGE)
set(OGS_CI_TESTRUNNER_REPEAT 3 CACHE STRING
"The number of testrunner repeats for the tests target")
set(TESTRUNNER_ADDITIONAL_ARGUMENTS ${TESTRUNNER_ADDITIONAL_ARGUMENTS}
--gtest_shuffle --gtest_repeat=3)
--gtest_shuffle --gtest_repeat=${OGS_CI_TESTRUNNER_REPEAT})
endif()
set(TESTRUNNER_ADDITIONAL_ARGUMENTS ${TESTRUNNER_ADDITIONAL_ARGUMENTS}
-l warn
Expand Down
7 changes: 7 additions & 0 deletions scripts/ci/extends/container-maker-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.container-maker-setup:
before_script:
- git submodule update --init ThirdParty/container-maker
- virtualenv .venv
- source .venv/bin/activate
- pip install -r ThirdParty/container-maker/requirements.txt
- export PYTHONPATH="${PYTHONPATH}:${PWD}/ThirdParty/container-maker"
3 changes: 3 additions & 0 deletions scripts/ci/extends/defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.defaults:
# Disable artifacts passing between stages
dependencies: []
5 changes: 5 additions & 0 deletions scripts/ci/extends/rules-master-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.rules-master-manual:
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- when: manual
allow_failure: true
24 changes: 24 additions & 0 deletions scripts/ci/extends/template-build-dockerfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# not working until https://gitlab.com/gitlab-org/gitlab-runner/issues/1809
# is implemented
# Usage:
#
# build pre-commit image:
# extends: .template-build-dockerfile
# variables:
# DOCKERFILE: scripts/docker/Dockerfile.pre-commit
# IMAGE_REF: $PRECOMMIT_IMAGE:latest
.template-build-dockerfile:
stage: .pre
only:
changes:
- $DOCKERFILE
- scripts/ci/extends/template-build-dockerfile.yml
tags:
- docker-shell
variables:
GIT_LFS_SKIP_SMUDGE: "1"
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $IMAGE_REF || true
- docker build --cache-from $IMAGE_REF -t $IMAGE_REF -f $DOCKERFILE scripts/docker
- docker push $IMAGE_REF
32 changes: 32 additions & 0 deletions scripts/ci/extends/template-build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.template-build-linux:
stage: build
tags:
- docker
extends:
- .defaults
- .test-artifacts

variables:
CCACHE_DIR: "$CI_PROJECT_DIR/.ccache"

before_script:
- git lfs install
- git lfs fetch
- git lfs checkout
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR

script:
- >
cmake .. -G Ninja
$CMAKE_ARGS
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DOGS_BUILD_PROCESSES=$BUILD_PROCESSES
- $BUILD_CMD_PREFIX cmake --build . > >(tee make.output)
- $BUILD_CMD_PREFIX cmake --build . --target tests
- $BUILD_CMD_PREFIX cmake --build . --target ctest
- cp Testing/**/Test.xml Tests/ctest.xml

cache:
paths:
- $CCACHE_DIR
23 changes: 23 additions & 0 deletions scripts/ci/extends/template-build-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.template-build-win:
stage: build
tags:
- windows
extends:
- .defaults
- .vs2019-environment
- .test-artifacts

variables:

script:
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR
- >
cmake .. -G Ninja
$env:CMAKE_ARGS.Split(" ")
-DCMAKE_BUILD_TYPE="$env:BUILD_TYPE"
-DOGS_BUILD_PROCESSES="$env:BUILD_PROCESSES"
- cmake --build . | Tee-Object -FilePath make.output
- cmake --build . --target tests
- cmake --build . --target ctest
- cp Testing/**/Test.xml Tests/ctest.xml
10 changes: 10 additions & 0 deletions scripts/ci/extends/test-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.test-artifacts:
artifacts:
paths:
- $BUILD_DIR/Tests/ctest.xml
- $BUILD_DIR/Tests/testrunner.xml
- $BUILD_DIR/make.output
expire_in: 1 week
reports:
junit:
- $BUILD_DIR/Tests/testrunner.xml
13 changes: 13 additions & 0 deletions scripts/ci/extends/vs2019-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.vs2019-environment:
before_script:
# Load VS environment
- |
pushd $env:VS160COMNTOOLS
cmd /c "VsDevCmd.bat -arch=amd64 -host_arch=amd64&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("=", 2); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
Write-Host "`nVisual Studio Command Prompt variables set." -ForegroundColor Yellow
17 changes: 17 additions & 0 deletions scripts/ci/jobs/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build docs:
stage: build
image:
name: $CONTAINER_GCC_IMAGE

before_script:
- mkdir -p build
- cd build

script:
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DOGS_USE_CONAN=OFF -DOGS_BUILD_PROCESSES=GroundwaterFlow
- cmake --build . --target doc > >(tee make-docs.output)

artifacts:
expose_as: 'Doxygen'
paths: ['build/docs/']
expire_in: 1 week
27 changes: 27 additions & 0 deletions scripts/ci/jobs/build-gui-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
build gui linux:
extends: .template-build-linux
stage: gui
tags:
- envinf1
- docker
needs:
- job: build linux
artifacts: false
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- changes:
- Applications/DataExplorer/**/*
- when: manual
allow_failure: true

variables:
BUILD_DIR: "build-gui-linux"
CMAKE_ARGS: >-
-DOGS_USE_CONAN=ON
-DOGS_USE_PCH=OFF
-DOGS_BUILD_GUI=ON
-DOGS_BUILD_UTILS=ON
-DOGS_USE_NETCDF=ON

image:
name: $CONTAINER_GCC_GUI_IMAGE
23 changes: 23 additions & 0 deletions scripts/ci/jobs/build-gui-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
build gui mac:
extends: .template-build-linux
stage: gui
needs:
- job: build mac
artifacts: false
tags:
- mac
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- changes:
- Applications/DataExplorer/**/*
- when: manual
allow_failure: true

variables:
BUILD_DIR: "build-gui-mac"
CMAKE_ARGS: >-
-DOGS_USE_CONAN=OFF
-DOGS_USE_PCH=OFF
-DOGS_BUILD_GUI=ON
-DOGS_BUILD_UTILS=ON
-DOGS_USE_NETCDF=ON
22 changes: 22 additions & 0 deletions scripts/ci/jobs/build-gui-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build gui win:
extends: .template-build-win
stage: gui
needs:
- job: build win
artifacts: false
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- changes:
- Applications/DataExplorer/**/*
- when: manual
allow_failure: true

variables:
BUILD_DIR: build-gui-win
CMAKE_ARGS: >-
-DOGS_USE_PYTHON=ON
-DOGS_BUILD_GUI=ON
-DOGS_BUILD_UTILS=ON
-DOGS_BUILD_SWMM=ON
-DOGS_USE_NETCDF=ON
-DOGS_CI_TESTRUNNER_REPEAT=1
22 changes: 22 additions & 0 deletions scripts/ci/jobs/build-linux-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build linux frontend:
extends: .template-build-linux
tags:
- frontend1
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- when: manual
allow_failure: true

variables:
BUILD_DIR: "build"
CCACHE_DIR: "/data/ogs/.ccache"
CMAKE_ARGS: "-DOGS_USE_CONAN=OFF -DOGS_DISABLE_CCACHE=OFF"

before_script:
- source scripts/env/eve/cli.sh
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR

cache:
paths:
# do not cache CCACHE_DIR
9 changes: 9 additions & 0 deletions scripts/ci/jobs/build-linux-petsc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build linux petsc:
extends: .template-build-linux
tags:
- envinf1
- docker-shell

variables:
BUILD_DIR: "build-petsc"
CMAKE_ARGS: "-DOGS_USE_CONAN=OFF -DOGS_USE_PETSC=ON -DBUILD_SHARED_LIBS=ON"
10 changes: 10 additions & 0 deletions scripts/ci/jobs/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build linux:
extends: .template-build-linux
tags:
- envinf1
- docker
variables:
BUILD_DIR: "build"
CMAKE_ARGS: "-DOGS_USE_CONAN=OFF"
image:
name: $CONTAINER_GCC_IMAGE
8 changes: 8 additions & 0 deletions scripts/ci/jobs/build-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build mac:
extends: .template-build-linux

tags:
- mac

variables:
BUILD_DIR: "build-mac"
Loading