110 lines
3.3 KiB
YAML
110 lines
3.3 KiB
YAML
# NS3 CI script
|
|
|
|
# For naming purposes, we will prepend ".base-" on the jobs
|
|
# that are not complete and need to be extended (hopefully
|
|
# we write in the documentation before the job what should be
|
|
# added to have a working jobs).
|
|
|
|
# As per Gitlab documentation, extends supports multi-level inheritance,
|
|
# however it is not recommended to use more than three levels.
|
|
|
|
# Any scheduled pipeline should define a variable, named "RELEASE", that
|
|
# indicates what this script is run for. Allowed values, for the moment,
|
|
# are "daily" and "weekly" to denote a daily (or weekly) job.
|
|
|
|
# Our configuration is not strictly sequential, or by using different
|
|
# words, we do not expect the CI infrastructure to run build, test, and
|
|
# documentation jobs each time that a commit is done. We use a different
|
|
# configuration, still in definition. It will be in the documentation.
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- coding-style
|
|
- documentation
|
|
|
|
###################### BUILD STAGE #############################################
|
|
|
|
# Defines the steps to run the tests
|
|
# Inherit with "extends: .base-build" and remember to set
|
|
# the following variables: COMPILER (g++, clang++, ...) and
|
|
# MODE (debug, default, optimized)
|
|
.base-build:
|
|
stage: build
|
|
script:
|
|
- mkdir -p $CCACHE_BASEDIR_VALUE
|
|
- export CCACHE_BASEDIR=${PWD}
|
|
- export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE
|
|
- export MPI_CI=1
|
|
- CXX=$COMPILER ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests --enable-asserts $ENABLE_MPI
|
|
- ./ns3 build
|
|
- if [ "$MODE" != "debug" ]; then ./test.py -n; fi
|
|
cache:
|
|
# Use separate key for each (debug/default/optimized) jobs because
|
|
# they run in parallel and will otherwise overwrite each other
|
|
# cache when they upload the cache archive at the end of the job,
|
|
# resulting in only the cache for the last finished configuration
|
|
# being stored.
|
|
#
|
|
# Do not distinguish between branches though to avoid
|
|
# recompilation of all the files when a new branch is created.
|
|
key: "ccache-$CI_JOB_NAME"
|
|
paths:
|
|
- $CCACHE_BASEDIR_VALUE/
|
|
when: "always"
|
|
timeout: 12h
|
|
variables:
|
|
CCACHE_BASEDIR_VALUE: ns-3-ccache-storage
|
|
|
|
# Defines the per-commit jobs. They are executed for any branch
|
|
.base-per-commit-compile:
|
|
extends: .base-build
|
|
except:
|
|
variables:
|
|
- $CPPYY == "True"
|
|
- $RELEASE == "weekly"
|
|
- $RELEASE == "daily"
|
|
image: archlinux
|
|
before_script:
|
|
- pacman-key --init
|
|
- pacman -Syu --noconfirm
|
|
base-devel gcc clang cmake ninja ccache
|
|
python
|
|
boost gsl gtk3
|
|
|
|
per-commit-clang-debug:
|
|
extends: .base-per-commit-compile
|
|
variables:
|
|
MODE: debug
|
|
COMPILER: clang++
|
|
|
|
per-commit-gcc-debug:
|
|
extends: .base-per-commit-compile
|
|
variables:
|
|
MODE: debug
|
|
COMPILER: g++
|
|
|
|
per-commit-gcc-default:
|
|
extends: .base-per-commit-compile
|
|
variables:
|
|
MODE: default
|
|
COMPILER: g++
|
|
|
|
per-commit-gcc-optimized:
|
|
extends: .base-per-commit-compile
|
|
variables:
|
|
MODE: optimized
|
|
COMPILER: g++
|
|
|
|
# Weekly jobs for other distribution and compilers
|
|
include:
|
|
- "utils/tests/gitlab-ci-alpine.yml"
|
|
- "utils/tests/gitlab-ci-ubuntu.yml"
|
|
- "utils/tests/gitlab-ci-fedora.yml"
|
|
- "utils/tests/gitlab-ci-gcc.yml"
|
|
- "utils/tests/gitlab-ci-clang.yml"
|
|
- "utils/tests/gitlab-ci-test.yml"
|
|
- "utils/tests/gitlab-ci-coding-style.yml"
|
|
- "utils/tests/gitlab-ci-doc.yml"
|
|
- "utils/tests/gitlab-ci-cppyy.yml"
|