ci: Skip .base-build job if no source code or configurations are changed

This commit is contained in:
Eduardo Almeida
2024-02-19 17:49:45 +00:00
parent 6dfd7f10f0
commit 9621afd8f2
8 changed files with 25 additions and 6 deletions

View File

@@ -21,7 +21,7 @@
bash
iproute2 linux-headers
openmpi openmpi-dev
openssh
openssh git
variables:
COMPILER: g++

View File

@@ -24,7 +24,7 @@
libgsl-dev $LIBGSL gsl-bin
libsqlite3-dev sqlite3
libxml2 libxml2-dev
ssh
ssh git
variables:
COMPILER: clang++-$CLANG

View File

@@ -28,6 +28,7 @@
python python-devel
pygobject3-devel python3-gobject gobject-introspection-devel
graphviz-devel graphviz ipython
git
- source /etc/profile.d/modules.sh
- module load mpi/openmpi-x86_64
variables:

View File

@@ -36,7 +36,7 @@
libsqlite3-dev sqlite3
libeigen3-dev
qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
ssh
ssh git
weekly-gcc:
rules:

View File

@@ -15,7 +15,7 @@
base-devel gcc clang libc++ cmake ninja ccache
python
boost gsl gtk3 openmpi
openssh
openssh git
# Build stage
per-commit-clang-optimized-libc++:

View File

@@ -16,7 +16,7 @@
python
boost gsl gtk3 openmpi
glibc-debug
openssh
openssh git
script:
- mkdir -p $CCACHE_BASEDIR_VALUE
- export CCACHE_BASEDIR=${PWD}

View File

@@ -28,7 +28,7 @@
libsqlite3-dev sqlite3
libeigen3-dev
qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
ssh
ssh git
weekly-ubuntu:
rules:

View File

@@ -45,6 +45,22 @@ workflow:
# MODE (debug, default, optimized)
.base-build:
script:
- if (git remote | grep -qw upstream) ; then
git remote remove upstream ;
fi
- git remote add -t $CI_DEFAULT_BRANCH --no-tags -f upstream https://gitlab.com/nsnam/ns-3-dev.git
- git diff --name-only upstream/$CI_DEFAULT_BRANCH > $FILES_CHANGED
# Run this job in the following cases: 1) default branch, 2) changes to source code, 3) changes to configurations.
# Skip this job in the opposite cases.
# File paths generated by git diff are relative to the working tree.
- |
if [[ $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH ]] &&
!(grep -qE ".*\.(cc|h)|CMakeLists.txt|build-support/|ns3|utils/tests/.*\.(yaml|yml)" $FILES_CHANGED) ; then
echo "No source code or configurations changes found in this MR. Skipping this job.";
exit 0;
fi
- mkdir -p $CCACHE_BASEDIR_VALUE
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE
@@ -82,11 +98,13 @@ workflow:
timeout: 12h
variables:
CCACHE_BASEDIR_VALUE: ns-3-ccache-storage
FILES_CHANGED: git-diff-name-only.txt
artifacts:
expire_in: 2 day
paths:
- build/
- .lock-*
- $FILES_CHANGED
# Weekly jobs for other distribution and compilers
include: