1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
# ns-3 CI/CD script with the platform tests stage
#
# Contains jobs to check the ns-3 build system and test script are fully working.
# Base platform test job
.test-platform-job-base:
stage: test
image: ubuntu:22.04
rules:
- if: $RELEASE == "weekly"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: manual
allow_failure: true
before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -y
cmake ccache g++ ninja-build python3 python3-venv pkg-config python3-pip docker.io lldb gdb git
libopenmpi-dev openmpi-bin openmpi-common
libboost-all-dev
doxygen sphinx graphviz dia imagemagick
python3-sphinx dia imagemagick texlive dvipng latexmk texlive-extra-utils texlive-latex-extra texlive-font-utils
valgrind
- python3 -m venv ns3env
- source ./ns3env/bin/activate
- python3 -m pip install python_on_whales GitPython cppyy django requests cmake-format
script:
- mkdir -p $CCACHE_BASEDIR_VALUE
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE
- ccache -M 3G # Set maximum cache size to 3GB
- ccache -F 0 # Remove the limit on number of files in the cache
- ./$TEST_SCRIPT
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/
timeout: 24h
interruptible: true
variables:
CCACHE_BASEDIR_VALUE: ns-3-ccache-storage
tags:
- nsnam
- linux
weekly-test-py:
extends: .test-platform-job-base
variables:
TEST_SCRIPT: ./utils/tests/test-test.py
weekly-test-ns3-py:
extends: .test-platform-job-base
variables:
TEST_SCRIPT: ./utils/tests/test-ns3.py
services:
- docker:dind-rootless
|