Commit d495bbab authored by Ben Boeckel's avatar Ben Boeckel

gitlab-ci: update to the new pattern

parent 10803d1e
# CI strategy for SMTK.
#
# Builders:
#
# - Fedora 31
# * ci/docker/fedora31
# - Python 3
#
# Wanted test sets:
#
# - OS
# - Windows
# - macOS
# - Compilers
# - Ubuntu LTS
# - CentOS
# - Features
# - Python 3 (minimum supported and latest)
# - Documentation
# - GUI testing
# - Need to figure out how it works with gitlab-runner.
# - Is offscreen rendering suitable?
.only_settings: &only_settings
- merge_requests
- branches@cmb/cmb
- tags@cmb/cmb
.fedora31: &fedora31
image: "kitware/cmb:ci-cmb-fedora31-20200910"
variables:
GIT_SUBMODULE_STRATEGY: recursive
CMAKE_CONFIGURATION: fedora31_plain
GIT_CLONE_PATH: $CI_BUILDS_DIR/gitlab-kitware-sciviz-ci
.fedora31_tidy: &fedora31_tidy
extends: .fedora31
variables:
CMAKE_CONFIGURATION: fedora31_tidy
CTEST_NO_WARNINGS_ALLOWED: 1
.fedora31_memcheck: &fedora31_memcheck
extends: .fedora31
variables:
CMAKE_BUILD_TYPE: RelWithDebInfo
.fedora31_asan: &fedora31_asan
extends: .fedora31_memcheck
variables:
CMAKE_CONFIGURATION: fedora31_asan
CTEST_MEMORYCHECK_TYPE: AddressSanitizer
# Disable LeakSanitizer for now. It's catching all kinds of errors that
# need investigated or suppressed.
CTEST_MEMORYCHECK_SANITIZER_OPTIONS: detect_leaks=0
.fedora31_ubsan: &fedora31_ubsan
extends: .fedora31_memcheck
variables:
CMAKE_CONFIGURATION: fedora31_ubsan
CTEST_MEMORYCHECK_TYPE: UndefinedBehaviorSanitizer
.fedora31_coverage: &fedora31_coverage
extends: .fedora31
variables:
CMAKE_BUILD_TYPE: Debug
CMAKE_CONFIGURATION: fedora31_coverage
CTEST_COVERAGE: 1
CMAKE_GENERATOR: Unix Makefiles
before_script:
- .gitlab/ci/cmake.sh
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
.cmake_build_unix: &cmake_build_unix
stage: build
only: *only_settings
tags:
- build
- cmb
- docker
- linux
script:
- .gitlab/ci/sccache.sh
- sccache --start-server
- sccache --show-stats
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
- sccache --show-stats
artifacts:
expire_in: 1d
paths:
# The artifacts of the build.
- build/bin/
- build/lib/
include:
# Metadata shared my many jobs
- local: .gitlab/rules.yml
- local: .gitlab/artifacts.yml
# CTest files.
- build/CTestCustom*.cmake
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/CTestTestfile.cmake
- build/*/CTestTestfile.cmake
- build/*/*/CTestTestfile.cmake
- build/*/*/*/CTestTestfile.cmake
- build/Testing/
- build/testing/temporary/
# CTest coverage files.
- build/CMakeFiles/TargetDirectories.txt
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/*/*/*/*.gcno
- build/*/*/*/*/*.gcno
- build/*/*/*/*/*/*.gcno
- build/*/*/*/*/*/*/*.gcno
- build/*/*.cxx
- build/*/*/*.cxx
- build/*/*/*.cpp
- build/*/*/*/*.cpp
- build/*/*/*/*/*.cpp
- build/*/*.h
- build/*/*/*.h
- build/*/*/*/*.h
- build/*/*/*/*/*.h
# CDash files.
- build/DartConfiguration.tcl
interruptible: true
.cmake_test_unix: &cmake_test_unix
stage: test
only: *only_settings
tags:
- cmb
- docker
- linux
- x11
script:
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_test.cmake"
interruptible: true
.cmake_memcheck_unix: &cmake_memcheck_unix
stage: test
only: *only_settings
tags:
- cmb
- docker
- linux
- x11
script:
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_memcheck.cmake"
interruptible: true
.cmake_memcheck_unix_priv: &cmake_memcheck_unix_priv
<<: *cmake_memcheck_unix
tags:
- cmb
- docker
- linux
- privileged
- x11
.cmake_coverage: &cmake_coverage
stage: analyze
only: *only_settings
tags:
- build
- cmb
- docker
- linux
script:
- "$LAUNCHER ctest -V -S .gitlab/ci/ctest_coverage.cmake"
coverage: '/Percentage Coverage: \d+.\d+%/'
interruptible: true
# OS builds.
- local: .gitlab/os-linux.yml
stages:
- build
- test
- analyze
build:fedora31:
<<:
- *fedora31
- *cmake_build_unix
test:fedora31:
<<:
- *fedora31
- *cmake_test_unix
################################################################################
# Job declarations
#
# Each job must pull in each of the following keys:
#
# - a "base image"
# - a build script
# - tags for the jobs
# - rules for when to run the job
#
# Additionally, jobs may also contain:
#
# - artifacts
# - dependency/needs jobs for required jobs
################################################################################
# Linux
## Build and test
build:fedora31-plain:
extends:
- .fedora31_plain
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_builder_tags
- .run_automatically
test:fedora31-plain:
extends:
- .fedora31_plain
- .cmake_test_linux
- .linux_test_tags
- .run_automatically
dependencies:
- build:fedora31
- build:fedora31-plain
needs:
- build:fedora31
- build:fedora31-plain
## Lint builds
build:fedora31-asan:
<<:
- *fedora31_asan
- *cmake_build_unix
extends:
- .fedora31_asan
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_builder_tags
- .run_automatically
test:fedora31-asan:
<<:
- *fedora31_asan
- *cmake_memcheck_unix_priv
extends:
- .fedora31_asan
- .cmake_memcheck_linux
- .linux_test_priv_tags
- .run_automatically
dependencies:
- build:fedora31-asan
needs:
- build:fedora31-asan
build:fedora31-ubsan:
<<:
- *fedora31_ubsan
- *cmake_build_unix
extends:
- .fedora31_ubsan
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_builder_tags
- .run_automatically
test:fedora31-ubsan:
<<:
- *fedora31_ubsan
- *cmake_memcheck_unix
extends:
- .fedora31_ubsan
- .cmake_memcheck_linux
- .linux_test_priv_tags
- .run_automatically
dependencies:
- build:fedora31-ubsan
needs:
- build:fedora31-ubsan
build:fedora31-tidy:
<<:
- *fedora31_tidy
- *cmake_build_unix
extends:
- .fedora31_tidy
- .cmake_build_linux_tidy
- .cmake_build_artifacts
- .linux_builder_tags
- .run_automatically
build:fedora31-coverage:
<<:
- *fedora31_coverage
- *cmake_build_unix
extends:
- .fedora31_coverage
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_builder_tags
- .run_automatically
test:fedora31-coverage:
<<:
- *fedora31_coverage
- *cmake_test_unix
artifacts:
expire_in: 1d
paths:
# CTest files.
- build/CTestCustom*.cmake
- build/Testing/
# CTest coverage files.
- build/CMakeFiles/TargetDirectories.txt
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/*/*/*/*.gcno
- build/*/*/*/*/*.gcno
- build/*/*/*/*/*/*.gcno
- build/*/*/*/*/*/*/*.gcno
- build/*/*/*/*.gcda
- build/*/*/*/*/*.gcda
- build/*/*/*/*/*/*.gcda
- build/*/*/*/*/*/*/*.gcda
- build/*/*.cxx
- build/*/*/*.cxx
- build/*/*/*.cpp
- build/*/*/*/*.cpp
- build/*/*/*/*/*.cpp
- build/*/*.h
- build/*/*/*.h
- build/*/*/*/*.h
- build/*/*/*/*/*.h
# CDash files.
- build/DartConfiguration.tcl
extends:
- .fedora31_coverage
- .cmake_test_linux
- .linux_test_tags
- .cmake_coverage_artifacts
- .run_automatically
dependencies:
- build:fedora31-coverage
needs:
- build:fedora31-coverage
analyze:fedora31-coverage:
<<:
- *fedora31_coverage
- *cmake_coverage
extends:
- .fedora31_coverage
- .cmake_coverage_linux
- .linux_builder_tags
- .run_automatically
dependencies:
- test:fedora31-coverage
needs:
......
# Lists of paths for artifacts of various stages.
.cmake_build_artifacts:
artifacts:
expire_in: 1d
paths:
# The artifacts of the build.
- build/bin/
- build/lib/
# CTest files.
- build/CTestCustom*.cmake
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/CTestTestfile.cmake
- build/*/CTestTestfile.cmake
- build/*/*/CTestTestfile.cmake
- build/*/*/*/CTestTestfile.cmake
- build/Testing/
- build/testing/temporary/
# CTest coverage files.
- build/CMakeFiles/TargetDirectories.txt
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/*/*/*/*.gcno
- build/*/*/*/*/*.gcno
- build/*/*/*/*/*/*.gcno
- build/*/*/*/*/*/*/*.gcno
- build/*/*.cxx
- build/*/*/*.cxx
- build/*/*/*.cpp
- build/*/*/*/*.cpp
- build/*/*/*/*/*.cpp
- build/*/*.h
- build/*/*/*.h
- build/*/*/*/*.h
- build/*/*/*/*/*.h
# CDash files.
- build/DartConfiguration.tcl
.cmake_coverage_artifacts:
artifacts:
expire_in: 1d
paths:
# CTest files.
- build/CTestCustom*.cmake
- build/Testing/
# CTest coverage files.
- build/CMakeFiles/TargetDirectories.txt
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/*/*/*/*.gcno
- build/*/*/*/*/*.gcno
- build/*/*/*/*/*/*.gcno
- build/*/*/*/*/*/*/*.gcno
- build/*/*/*/*.gcda
- build/*/*/*/*/*.gcda
- build/*/*/*/*/*/*.gcda
- build/*/*/*/*/*/*/*.gcda
- build/*/*.cxx
- build/*/*/*.cxx
- build/*/*/*.cpp
- build/*/*/*/*.cpp
- build/*/*/*/*/*.cpp
- build/*/*.h
- build/*/*/*.h
- build/*/*/*/*.h
- build/*/*/*/*/*.h
# CDash files.
- build/DartConfiguration.tcl
# Linux-specific builder configurations and build commands
## Base images
### Fedora
.fedora31:
image: "kitware/cmb:ci-cmb-fedora31-20200910"
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_CLONE_PATH: $CI_BUILDS_DIR/gitlab-kitware-sciviz-ci
### Lint builds
.fedora31_tidy:
extends: .fedora31
variables:
CMAKE_CONFIGURATION: fedora31_tidy
CTEST_NO_WARNINGS_ALLOWED: 1
.fedora31_memcheck:
extends: .fedora31
variables:
CMAKE_BUILD_TYPE: RelWithDebInfo
.fedora31_asan:
extends: .fedora31_memcheck
variables:
CMAKE_CONFIGURATION: fedora31_asan
CTEST_MEMORYCHECK_TYPE: AddressSanitizer
# Disable LeakSanitizer for now. It's catching all kinds of errors that
# need investigated or suppressed.
CTEST_MEMORYCHECK_SANITIZER_OPTIONS: detect_leaks=0
.fedora31_ubsan:
extends: .fedora31_memcheck
variables:
CMAKE_CONFIGURATION: fedora31_ubsan
CTEST_MEMORYCHECK_TYPE: UndefinedBehaviorSanitizer
.fedora31_coverage:
extends: .fedora31
variables:
CMAKE_BUILD_TYPE: Debug
CMAKE_CONFIGURATION: fedora31_coverage
CTEST_COVERAGE: 1
CMAKE_GENERATOR: Unix Makefiles
### Build and test
.fedora31_plain:
extends: .fedora31
image: "kitware/cmb:ci-cmb-fedora31-20200910"
variables:
CMAKE_CONFIGURATION: fedora31_plain
## Tags
.linux_builder_tags:
tags:
- build
- cmb
- docker
- linux
.linux_test_tags:
tags:
- cmb
- docker
- linux
- x11
.linux_test_priv_tags:
tags:
- cmb
- docker
- linux
- privileged
- x11
## Linux-specific scripts
.before_script_linux: &before_script_linux
- .gitlab/ci/cmake.sh
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
.cmake_build_linux:
stage: build
script:
- *before_script_linux
- .gitlab/ci/sccache.sh
- sccache --start-server
- sccache --show-stats
- "$LAUNCHER ctest -V -S .gitlab/ci/ctest_configure.cmake"
- "$LAUNCHER ctest -V -S .gitlab/ci/ctest_build.cmake"
- sccache --show-stats
interruptible: true
.cmake_build_linux_tidy:
stage: build
script:
- *before_script_linux
- dnf install -y --setopt=install_weak_deps=False clang-tools-extra
- .gitlab/ci/sccache.sh
- sccache --start-server
- sccache --show-stats
- "$LAUNCHER ctest -V -S .gitlab/ci/ctest_configure.cmake"
- "$LAUNCHER ctest -V -S .gitlab/ci/ctest_build.cmake"
- sccache --show-stats
interruptible: true
.cmake_test_linux:
stage: test
script:
- *before_script_linux
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake"
interruptible: true
.cmake_memcheck_linux:
stage: test
script:
- *before_script_linux
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_memcheck.cmake"
interruptible: true
.cmake_coverage_linux:
stage: analyze
script:
- *before_script_linux
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_coverage.cmake"
coverage: '/Percentage Coverage: \d+.\d+%/'
interruptible: true
# Rules for where jobs can run
.run_automatically:
rules:
- if: '$CI_MERGE_REQUEST_ID'
when: on_success
- if: '$CI_PROJECT_PATH == "cmb/cmb"'
when: delayed
start_in: 30 minutes
- when: never
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment