Skip to content

Commit

Permalink
Merge pull request #285 from jdriesch/main
Browse files Browse the repository at this point in the history
Update latest version Run3
  • Loading branch information
jdriesch authored Nov 25, 2024
2 parents e36ef4d + f36d394 commit 58a139e
Show file tree
Hide file tree
Showing 212 changed files with 25,451 additions and 1,383 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_unittest_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CI step to build the unittest container to be used for the other CI steps
# publish the container in the github container registry

name: Checks

# This workflow should only run when the Dockerfile changes
on:
push:
paths:
- docker/Dockerfile
pull_request:
paths:
- docker/Dockerfile
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-crown-unittest

jobs:
build_unittest_container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
109 changes: 81 additions & 28 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Checks

on:
workflow_run:
workflows: ["build_unittest_container"]
push:
branches:
- main
Expand All @@ -17,38 +19,54 @@ env:
ERAS: 2018
SCOPES: "mt,mm,et"
SHIFTS: "all"
SINGLE_FRIEND_SCOPES: "mt,mm"
SINGLE_FRIEND_CONFIG: unittest_friends
TWO_FRIENDS_SCOPES: "mt"
TWO_FRIENDS_CONFIG: unittest_friends_2
FRIEND_SHIFTS: "nominal,jesUncTotalUp,jesUncTotalDown,tauMuFakeEsDown"

jobs:
build_project:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-arch
image: ghcr.io/kit-cms/crown-crown-unittest:latest
options: --user 0 # run as root

steps:
- name: update Arch keyring
run: pacman -Syy --noconfirm && pacman -Sy archlinux-keyring --noconfirm
- name: Clone project
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.CERN_GITLAB_PRIVATE_KEY }}
submodules: "recursive"
ssh-strict: "false"
ssh-known-hosts: "[gitlab.cern.ch]:7999 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubVS0czgKaPkC5cfB75CI3XjgWBv7pj2ILiZezVf8okkCAYr+bf4w6VrH2pyv3NRUW5Mm8U/3zoSNcrYIqhFFpz6R62/3xt8hMrPKJKstbt1lSIr8QhEyD24SJEKugMi560BWRPkTzXrrFgxz0X4vuKKytpvihRsccZ7F1JaX76UCWEJ3Xr2BFCEnnN6gj9nvFr4gvSMneunWVLGw2KcHwS1OJfnWBlp3fB0rYWSxZAoVjcjZjvv3hioEftaTapff2PkdQIX//N9Cc555FzdmMzixTvU5j/i+QvjxWVbEBNSKI6te6udC4fYUZMePs2QQnqw9mXUQtaQtw+HV7utuw=="

- name: Install missing software
run: pacman -Syu --noconfirm cmake make git python-pip openmp openmpi boost --ignore root --ignore libinih
- name: Create Build Environment
shell: bash
run: cmake -E make_directory ${{github.workspace}}/build

# - name: apt update
# run: apt-get -y update
- name: adding a system path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

# - name: add python 3.9 from deadsnakes
# run: apt-get install -y software-properties-common && add-apt-repository -y ppa:deadsnakes/ppa
- name: Configure CMake
shell: bash
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$SCOPES -DSHIFTS=$SHIFTS -DOPTIMIZED=false -DONNXRUNTIME_INCLUDE_DIR=/opt/onnxruntime

# - name: Install python 3.9
# run: apt-get install -y python3.9 python3.9-dev python3.9-venv
- name: Build
shell: bash
run: cd ${{github.workspace}}/build && make install -j 2

# - name: apt update
# run: apt-get -y update
- name: Test
shell: bash
run: cd ${{github.workspace}}/build && ctest -V --label-regex "ntuple.*."

# - name: Install missing software
# run: apt-get install -y make git build-essential mlocate
build_single_friend:
runs-on: ubuntu-22.04
container:
image: ghcr.io/kit-cms/crown-crown-unittest:latest
options: --user 0 # run as root

- name: Install python packages
run: python -m ensurepip --default-pip && python -m pip install GitPython && python -m pip install numpy --upgrade && python -m pip install git+https://github.com/cms-nanoAOD/correctionlib.git
steps:

- name: Clone project
uses: actions/checkout@v3
Expand All @@ -67,28 +85,63 @@ jobs:

- name: Configure CMake
shell: bash
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$SCOPES -DSHIFTS=$SHIFTS -DOPTIMIZED=false
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$SINGLE_FRIEND_CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$SINGLE_FRIEND_SCOPES -DSHIFTS=$FRIEND_SHIFTS -DOPTIMIZED=false -DQUANTITIESMAP="dummy" -DONNXRUNTIME_INCLUDE_DIR=/opt/onnxruntime

- name: Build
shell: bash
run: cd ${{github.workspace}}/build && make install
run: cd ${{github.workspace}}/build && make install -j 2

- name: Test
shell: bash
run: cd ${{github.workspace}}/build && ctest -V
run: cd ${{github.workspace}}/build && ctest -V --label-regex "single_friend.*."

build_two_friends:
runs-on: ubuntu-22.04
container:
image: ghcr.io/kit-cms/crown-crown-unittest:latest
options: --user 0 # run as root

steps:
- name: Clone project
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.CERN_GITLAB_PRIVATE_KEY }}
submodules: "recursive"
ssh-strict: "false"
ssh-known-hosts: "[gitlab.cern.ch]:7999 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubVS0czgKaPkC5cfB75CI3XjgWBv7pj2ILiZezVf8okkCAYr+bf4w6VrH2pyv3NRUW5Mm8U/3zoSNcrYIqhFFpz6R62/3xt8hMrPKJKstbt1lSIr8QhEyD24SJEKugMi560BWRPkTzXrrFgxz0X4vuKKytpvihRsccZ7F1JaX76UCWEJ3Xr2BFCEnnN6gj9nvFr4gvSMneunWVLGw2KcHwS1OJfnWBlp3fB0rYWSxZAoVjcjZjvv3hioEftaTapff2PkdQIX//N9Cc555FzdmMzixTvU5j/i+QvjxWVbEBNSKI6te6udC4fYUZMePs2QQnqw9mXUQtaQtw+HV7utuw=="

- name: Create Build Environment
shell: bash
run: cmake -E make_directory ${{github.workspace}}/build

- name: adding a system path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Configure CMake
shell: bash
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$TWO_FRIENDS_CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$TWO_FRIENDS_SCOPES -DSHIFTS=$FRIEND_SHIFTS -DOPTIMIZED=false -DQUANTITIESMAP="dummy" -DONNXRUNTIME_INCLUDE_DIR=/opt/onnxruntime

- name: Build
shell: bash
run: cd ${{github.workspace}}/build && make install -j 2

- name: Test
shell: bash
run: cd ${{github.workspace}}/build && ctest -V --label-regex "two_friends.*."


python_format:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-ubuntu20.04
image: ghcr.io/kit-cms/crown-crown-unittest:latest
options: --user 0 # run as root

steps:
- name: apt update
run: apt-get -y update

- name: Install missing software
run: apt-get install -y git python3-pip && pip install black
run: apt-get install -y git python3-pip && pip install black==23.3.0

- uses: actions/checkout@v2

Expand All @@ -97,9 +150,9 @@ jobs:
run: cd $GITHUB_WORKSPACE && bash checks/python-formatting.sh

cpp_format:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-ubuntu20.04
image: ghcr.io/kit-cms/crown-crown-unittest:latest
options: --user 0 # run as root

steps:
Expand All @@ -116,9 +169,9 @@ jobs:
run: cd $GITHUB_WORKSPACE && bash checks/cpp-formatting.sh

docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-ubuntu20.04
image: ghcr.io/kit-cms/crown-crown-unittest:latest
options: --user 0 # run as root

steps:
Expand Down
8 changes: 7 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
# Required
version: 2

# Set the OS, Python version and other tools you might need

build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/sphinx_source/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/sphinx_source/requirements.txt
Loading

0 comments on commit 58a139e

Please sign in to comment.