forked from llr-cta/calin
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (96 loc) · 3.5 KB
/
native-build-and-test.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# calin/.github/workflows/native-build-and-test.yml - Stephen Fegan - 2021-08-19
#
# Continuous integration using Github Actions : build and test calin
#
# Copyright 2021, Stephen Fegan <sfegan@llr.in2p3.fr>
# Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris
#
# This file is part of "calin"
#
# "calin" is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 or later, as published by
# the Free Software Foundation.
#
# "calin" is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
name: Native build and test
on:
push:
branches:
- main
paths-ignore:
- singularity_build.def
- .github/workflows/singularity-build-and-deploy.yml
- azure-pipelines.yml
- Dockerfile
- README.md
pull_request:
branches:
- main
paths-ignore:
- singularity_build.def
- .github/workflows/singularity-build-and-deploy.yml
- azure-pipelines.yml
- Dockerfile
- README.md
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [ [gcc-11, g++-11, 'gcc-11 g++-11', broadwell ],
[gcc-10, g++-10, 'gcc-10 g++-10', broadwell ],
[gcc-9, g++-9, 'gcc-9 g++-9', broadwell ],
[gcc-8, g++-8, 'gcc-8 g++-8', broadwell ],
[gcc-7, g++-7, 'gcc-7 g++-7', broadwell ],
[clang-12, clang++-12, 'clang-12', broadwell ],
[clang-11, clang++-11, 'clang-11', broadwell ],
[clang-10, clang++-10, 'clang-10', broadwell ] ]
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.compiler[0] }}
CXX: ${{ matrix.compiler[1] }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y gsl-bin libgsl0-dev libfftw3-dev python-numpy \
libzmq3-dev python3 python3-dev python3-numpy libxerces-c-dev \
libpcap-dev libz-dev libprotobuf-c-dev protobuf-c-compiler \
libprotobuf-dev protobuf-compiler libprotoc-dev libzstd-dev \
${{ matrix.compiler[2] }}
curl -L https://github.com/llr-cta/CamerasToACTLRelease/releases/download/latest/CamerasToACTL.tgz | sudo tar -zxf - -C /
curl -L https://github.com/llr-cta/Geant4Build/releases/download/ubuntu-20.04-10.7.2/Geant4-ubuntu-20.04-10.7.2.tbz2 | sudo tar -jxf - -C /
- name: Print version information
shell: bash
run: |
swig -version
cmake -version
$CC -v
python -V
python3 -V
- name: Configure build
shell: bash
run: |
mkdir mybuild
cd mybuild
cmake -DCALIN_BUILD_ARCH=${{ matrix.compiler[3] }} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCALIN_PYTHON_SUB_DIR=lib/python3.8 \
-DNO_GEANT4_TEST:BOOLEAN=TRUE \
..
- name: Build
shell: bash
run: |
cd mybuild
make -j3
- name: Test
shell: bash
run: |
cd mybuild
ctest --output-on-failure