

dist: bionic

services:
  - docker

language: cpp

env:
  matrix:
    - COMPILER=gcc;   LCG_RELEASE=LCG_96c_LS; STANDARD=17; COMPILER_VERSION=gcc8;

before_install:
  - wget --no-check-certificate https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb
  - sudo dpkg -i cvmfs-release-latest_all.deb
  - sudo apt-get update
  - sudo apt-get install cvmfs cvmfs-config-default
  - rm -f cvmfs-release-latest_all.deb
  - sudo mkdir -p /etc/cvmfs
  - echo "CVMFS_QUOTA_LIMIT='32140'"                                | sudo tee     /etc/cvmfs/default.local > /dev/null
  - echo "CVMFS_HTTP_PROXY=DIRECT"                                  | sudo tee -a  /etc/cvmfs/default.local > /dev/null
  - echo "CVMFS_CACHE_BASE='/var/lib/cvmfs'"                        | sudo tee -a  /etc/cvmfs/default.local > /dev/null
  - echo "CVMFS_FORCE_SIGNING='yes'"                                | sudo tee -a  /etc/cvmfs/default.local > /dev/null
  - echo "CVMFS_REPOSITORIES='sft.cern.ch,sw-nightlies.hsf.org'"    | sudo tee -a  /etc/cvmfs/default.local > /dev/null
  - echo "CVMFS_SEND_INFO_HEADER=no"                                | sudo tee -a  /etc/cvmfs/default.local > /dev/null
  - cat /etc/cvmfs/default.local
  - # change wrt dd4hep setup: don't manually mount cvmfs folders
  - #sudo /etc/init.d/autofs stop
  - sudo cvmfs_config setup
  - sudo cvmfs_config probe
  - sudo mkdir -p /cvmfs/sft.cern.ch
  - sudo mkdir -p /cvmfs/sft-nightlies.cern.ch
  - sudo mkdir -p /cvmfs/geant4.cern.ch
  - sudo mkdir -p /cvmfs/sw-nightlies.hsf.org
  - ls /cvmfs/sft.cern.ch
  - ls /cvmfs/geant4.cern.ch
  - ls /cvmfs/sw-nightlies.hsf.org
  - export CVMFS_REPOS="-v /cvmfs/sft.cern.ch:/cvmfs/sft.cern.ch"
  - export CVMFS_REPOS="${CVMFS_REPOS} -v /cvmfs/sw-nightlies.hsf.org:/cvmfs/sw-nightlies.hsf.org"
  - export CVMFS_REPOS="${CVMFS_REPOS} -v /cvmfs/geant4.cern.ch:/cvmfs/geant4.cern.ch"


# command to install dependencies
install:
  - shopt -s extglob dotglob
  - mkdir package
  - mv !(package) package
  - shopt -u dotglob
  - export PKGDIR=${PWD}/package

# command to run tests
script:
  - docker run -ti --name CI_CONTAINER -v $PKGDIR:/workspace -e COMPILER_TYPE=$COMPILER -e LCG_RELEASE=${LCG_RELEASE} -e STANDARD=${STANDARD} -e COMPILER_VERSION=${COMPILER_VERSION} ${CVMFS_REPOS} -d cepc/cepcsw bash 
  - docker exec -ti CI_CONTAINER  /bin/bash -c "cd /workspace; ln -s /usr/lib64/liblzma.so.5.2.2 /usr/lib64/liblzma.so; echo 'hello world'"


# Don't send e-mail notifications
notifications:
  email: false
