Files
unison/utils/tests/gitlab-ci-build.yml
2025-08-25 22:34:23 +02:00

59 lines
1.8 KiB
YAML

# 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:rolling
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 imagemagick git
- python3 -m venv ns3env
- source ./ns3env/bin/activate
- python3 -m pip install python_on_whales GitPython cppyy django requests
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