-
Notifications
You must be signed in to change notification settings - Fork 429
77 lines (72 loc) · 2.21 KB
/
ci.yml
File metadata and controls
77 lines (72 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI/CD
on:
workflow_dispatch:
pull_request:
paths:
- '**CMakeLists.txt'
- '**.cmake'
- '**.h'
- '**.cc'
- '**.cxx'
- '**.py'
- '**.yml'
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
name: Run linter (flake8+black)
steps:
- uses: actions/checkout@master
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Lint with flake8 and black -l 160
run: |
python -m pip install -q flake8 black
black --version
flake8 .
black -l 160 --check --diff .
build:
strategy:
fail-fast: false
matrix:
python: ["3.10"]
root: ["6.26.4"]
include:
- python: "3.10"
root: "6.32.2"
- python: "3.12"
root: "6.34.4"
runs-on: ubuntu-latest
name: Compile (py${{ matrix.python }}, root${{ matrix.root }})
steps:
- uses: actions/checkout@master
with:
path: HiggsAnalysis/CombinedLimit # Required to match compile instructions
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
miniforge-version: latest
- name: Install build environment
shell: bash -l {0}
run: |
# Install dependencies (synchronize with cms-combine-feedstock recipe.yaml)
mamba install -c conda-forge cmake python==${{ matrix.python }} pandas gsl root==${{ matrix.root }} boost-cpp eigen
- name: Build
shell: bash -l {0}
run: |
cmake -S HiggsAnalysis/CombinedLimit -B build -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_INSTALL_PYTHONDIR=lib/python${{ matrix.python }}/site-packages -DUSE_VDT=OFF -DBUILD_TESTS=ON
cmake --build build --clean-first --parallel "$(nproc)"
cmake --install build # Install to conda prefix (unsafe but ok for CI)
- name: Run tests
shell: bash -l {0}
# Check if executables and Python module works, and then run the test battery
run: |
combine --help > /dev/null
text2workspace.py --help > /dev/null
ulimit -s unlimited;
ctest --test-dir build/test --output-on-failure