Skip to content

[ci] Remove redundant tests from the CMSSW CI #864

[ci] Remove redundant tests from the CMSSW CI

[ci] Remove redundant tests from the CMSSW CI #864

Workflow file for this run

name: CVMFS CI
on:
workflow_dispatch:
pull_request:
paths:
- '**.h'
- '**.cc'
- '**.cxx'
- '**.py'
- '**.yml'
push:
branches:
- main
jobs:
test_workflow:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- IMAGE: "cmscloud/al9-cms"
CMSSW_VERSION: "CMSSW_14_1_0_pre4"
SCRAM_ARCH: "el9_amd64_gcc12"
ROOT: "6.30.07"
- IMAGE: "cmscloud/cc7-cms"
CMSSW_VERSION: "CMSSW_11_3_4"
SCRAM_ARCH: "slc7_amd64_gcc900"
ROOT: "6.22.09"
- IMAGE: "cmscloud/al9-cms"
CMSSW_VERSION: "CMSSW_14_0_0_pre1"
SCRAM_ARCH: "el9_amd64_gcc12"
ROOT: "6.26.11"
- LCG_RELEASE: "LCG_102"
LCG_ARCH: "x86_64-ubuntu2204-gcc11-opt"
ROOT: "6.26.04"
- LCG_RELEASE: "LCG_106"
LCG_ARCH: "x86_64-ubuntu2204-gcc11-opt"
ROOT: "6.32.02"
- LCG_RELEASE: "LCG_108"
LCG_ARCH: "x86_64-ubuntu2204-gcc11-opt"
ROOT: "6.36.02"
coverage: true
- LCG_RELEASE: "dev3/latest"
LCG_ARCH: "x86_64-ubuntu2204-gcc11-opt"
ROOT: "LCG master"
name: ${{ matrix.CMSSW_VERSION }}${{ matrix.LCG_RELEASE }} - ROOT ${{ matrix.ROOT }}
env:
CMSSW_VERSION: ${{ matrix.CMSSW_VERSION }}
IMAGE: ${{ matrix.IMAGE }}
LCG_RELEASE: ${{ matrix.LCG_RELEASE }}
LCG_ARCH: ${{ matrix.LCG_ARCH }}
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: ${{ (env.CMSSW_VERSION != '') && 'cms.cern.ch' || 'sft.cern.ch' }}
- name: Setup compiler
run: |
echo "CC=$(which gcc)" >> $GITHUB_ENV
echo "CXX=$(which g++)" >> $GITHUB_ENV
- name: Setup code coverage
if: ${{ (matrix.coverage == true) }}
run: |
sudo apt install -y lcov
# Workaround ubuntu lcov-1.15-1 package bug
if sudo apt list lcov --installed | grep "1.15-1" ; then
wget https://launchpad.net/ubuntu/+source/lcov/1.15-2/+build/23784466/+files/lcov_1.15-2_all.deb
sudo apt install -y ./lcov_1.15-2_all.deb
fi
echo "COMBINE_CODE_COVERAGE=1" >> $GITHUB_ENV
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV
- name: Build Combine (LCG)
if: ${{ env.CMSSW_VERSION == '' }}
env:
LCG_RELEASE: ${{ matrix.LCG_RELEASE }}
LCG_ARCH: ${{ matrix.LCG_ARCH }}
# VDT doesn't seem to be available in LCG_102.
# But also it's very good to also test builds with USE_VDT=OFF.
USE_VDT: ${{ matrix.LCG_RELEASE != 'LCG_102' && 'TRUE' || 'FALSE' }}
run: >-
source /cvmfs/sft.cern.ch/lcg/views/${LCG_RELEASE}/${LCG_ARCH}/setup.sh;
root --version;
mkdir build;
cd build;
cmake -DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_BUILD_TYPE=$([[ -z "$BUILD_TYPE" ]] && echo RelWithDebInfo || echo $BUILD_TYPE) \
-DCOMBINE_CODE_COVERAGE=${{ env.COMBINE_CODE_COVERAGE }} \
-DUSE_VDT=${USE_VDT} \
-DBUILD_TESTS=TRUE \
..;
make install -j$(nproc);
echo "RooFit.Banner: 0" > .rootrc;
echo "RooFit.Banner: 0" > test/.rootrc;
cd ..;
export PATH=$PWD/install/bin:$PATH;
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH;
- uses: rhaschke/docker-run-action@v5
name: Build Combine (CMSSW)
# Only run the CMSSW build step if the CMSSW_VERSION is defined. Otherwise we build for LCG.
if: ${{ env.CMSSW_VERSION != '' }}
with:
image: ${{ matrix.IMAGE }}
shell: bash
options: -v /cvmfs:/cvmfs:shared -v ${{ github.workspace }}:/work/CombinedLimit --mount source=cmsusr,destination=/home/cmsusr -w /home/cmsusr -e CMSSW_VERSION=${{ matrix.CMSSW_VERSION }} -e SCRAM_ARCH=${{ matrix.SCRAM_ARCH }}
run: |
cd /home/cmsusr/
source /cvmfs/cms.cern.ch/cmsset_default.sh
scram project ${CMSSW_VERSION}
cd ${CMSSW_VERSION}/src
cmsenv
mkdir -p HiggsAnalysis
cp -r /work/CombinedLimit HiggsAnalysis/
scramv1 b -j$(nproc --ignore=2)
echo ${PATH}
root --version
combine --help
- uses: ./.github/actions/run-in-cvmfs
name: Check scripts/*.py executables
# Only run this test in CMSSW mode, because otherwise we already run this in the unit tests
if: ${{ env.CMSSW_VERSION != '' }}
with:
script: |
combineCards.py --help
combineTool.py --help
commentUncerts.py --help
plot1DScan.py --help
plotBSMxsBRLimit.py --help
plotGof.py --help
plotImpacts.py --help
plotLimitGrid.py --help
plotLimits.py --help
pruneUncerts.py --help
text2workspace.py --help
- name: Run Tests (LCG)
if: ${{ env.CMSSW_VERSION == '' }}
env:
LCG_RELEASE: ${{ matrix.LCG_RELEASE }}
LCG_ARCH: ${{ matrix.LCG_ARCH }}
run: >-
source /cvmfs/sft.cern.ch/lcg/views/${LCG_RELEASE}/${LCG_ARCH}/setup.sh;
ulimit -s unlimited;
ctest --test-dir build/test --output-on-failure -j$(nproc);
# AlmaLinux 9 job
- uses: ./.github/actions/run-in-cvmfs
name: Run Tests (CMSSW, AlmaLinux 9)
if: ${{ matrix.IMAGE == 'cmscloud/al9-cms' }}
with:
script: |
set -euxo pipefail
mkdir build_test
cd build_test
cmake ../test
cmake --build . -j"$(nproc)"
cd ..
ctest --test-dir build_test --output-on-failure
# CentOS 7 job
- uses: ./.github/actions/run-in-cvmfs
name: Run Tests (CMSSW, CentOS 7)
if: ${{ matrix.IMAGE == 'cmscloud/cc7-cms' }}
with:
script: |
set -euxo pipefail
sudo yum install -y epel-release
sudo yum install -y cmake3
mkdir build_test
cd build_test
cmake3 ../test
cmake3 --build . -j"$(nproc)"
cd ..
cd build_test
ctest3 --output-on-failure .
- uses: ./.github/actions/run-in-cvmfs
name: Countind datacard Fixed Point from csv
if: ${{ env.CMSSW_VERSION != '' }}
with:
script: |
text2workspace.py data/tutorials/multiDim/toy-hgg-125.txt -m 125 -P HiggsAnalysis.CombinedLimit.PhysicsModel:floatingXSHiggs --PO modes=ggH,qqH
combineTool.py -M MultiDimFit data/tutorials/multiDim/toy-hgg-125.root --fromfile data/tutorials/multiDim/fixed.csv
- uses: ./.github/actions/run-in-cvmfs
name: RooMultiPdf
if: ${{ !matrix.CMSSW_VERSION || startsWith(matrix.CMSSW_VERSION, 'CMSSW_14') }}
with:
script: |
text2workspace.py data/ci/datacard_RooMultiPdf.txt.gz -o ws_RooMultiPdf.root
combine -M MultiDimFit -m 125.38 --setParameters pdf_index_ggh=2 --freezeParameters MH --cminDefaultMinimizerStrategy 0 --X-rtd FAST_VERTICAL_MORPH --X-rtd MINIMIZER_freezeDisassociatedParams --X-rtd MINIMIZER_multiMin_maskChannels=2 --algo singles ws_RooMultiPdf.root
- uses: ./.github/actions/run-in-cvmfs
name: RooParametricHist
with:
script: |
text2workspace.py -P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel --PO verbose --PO 'map=.*/*hcc*:r[1,-500,500]' --PO 'map=.*/zcc:z[1,-5,5]' data/ci/datacard_RooParametricHist.txt -o ws_RooParametricHist.root
combine -M MultiDimFit ws_RooParametricHist.root --algo singles
- uses: ./.github/actions/run-in-cvmfs
name: RooHistPdf
if: ${{ !matrix.CMSSW_VERSION || startsWith(matrix.CMSSW_VERSION, 'CMSSW_14') }}
with:
script: |
text2workspace.py data/ci/datacard_RooHistPdf.txt.gz -o ws_RooHistPdf.root
combine -M MultiDimFit ws_RooHistPdf.root --algo singles -v -2 --setParameterRanges r=-1,2.
- uses: ./.github/actions/run-in-cvmfs
name: Template analysis with large integrals
with:
script: |
text2workspace.py data/ci/templ_datacard_largeYields.txt -o ws_template-analysis.root
combine -M MultiDimFit ws_template-analysis.root --algo singles --setParameterRanges r=-5,5
- uses: ./.github/actions/run-in-cvmfs
name: Template analysis with large integrals using CMSHistSum
with:
script: |
text2workspace.py data/ci/templ_datacard_largeYields.txt -o ws_template-analysis.root --for-fits --no-wrappers --use-histsum
combine -M MultiDimFit ws_template-analysis.root --algo singles --setParameterRanges r=-5,5 --X-rtd FAST_VERTICAL_MORPH
- uses: ./.github/actions/run-in-cvmfs
name: InterferenceModel test in CMSSW
if: ${{ env.CMSSW_VERSION != '' }}
with:
script: |
cd test
python3 test_interference.py
- uses: ./.github/actions/run-in-cvmfs
name: FastScan template analysis CMSHistFunc
with:
script: |
text2workspace.py data/ci/template-analysis_shapeInterp.txt -o ws_template-analysis.root --mass 200
combineTool.py -M FastScan -w ws_template-analysis.root:w
- name: Prepare code coverage report
if: ${{ success() && (matrix.coverage == true) }}
run: |
# Create lcov report
# capture coverage info
lcov --directory . --capture --output-file coverage.info --gcov-tool $CONDA_PREFIX/bin/gcov --ignore-errors gcov
# filter out system and extra files.
# To also not include test code in coverage add them with full path to the patterns: '*/ci/*'
lcov --remove coverage.info \
'/usr/*' \
"${HOME}/.cache/*" \
'*/ci/*' \
--output-file coverage.info
# output coverage data for debugging (optional)
lcov --list coverage.info
- name: Upload to codecov.io
if: ${{ success() && (matrix.coverage == true) }}
uses: codecov/codecov-action@v5
with:
files: ./coverage.info
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}