forked from CRPropa/CRPropa3
-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (75 loc) · 2.88 KB
/
testing_OSX.yml
File metadata and controls
78 lines (75 loc) · 2.88 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
78
name: crpropa-testing_OSX
on: [push, pull_request]
jobs:
mac:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "macos-14"
os: macos-14
cxx: "clang++"
cc: "clang"
fc: "gfortran-14"
swig_builtin: "On" #uses swig 4.0.2
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Preinstall
run: |
brew reinstall python@3.13 llvm@15
brew install hdf5 fftw cfitsio muparser libomp swig
pip install numpy==1.26.4 cmake
pip show numpy # cross-check numpy version for Python_Numpy_INCLUDE_DIR
- name: Set up the build
env:
CXX: ${{ matrix.config.cxx }}
CC: ${{ matrix.config.cc }}
FC: ${{ matrix.config.fc }}
CRPROPA_DATA_PATH: "/Users/runner/work/CRPropa3/CRPropa3/build/data"
run: |
mkdir build
cd build
# define paths for LLVM, Python, and OpenMP
export LLVM_DIR=$(brew --prefix llvm@15)
export PYTHON_VERSION=3.13
export LLVM_VERSION=15.0.7
export OMP_VERSION=$(brew list --versions libomp | awk '{print $2}')
export OMP_DIR=$(brew --prefix libomp)
export PYTHON_DIR=/Library/Frameworks/Python.framework/Versions/3.13/
# print paths for debugging
echo "Using LLVM_DIR: $LLVM_DIR"
echo "Using OMP_DIR: $OMP_DIR"
echo "python version: $(python --version) from $(which python)"
echo "Using Python_DIR: $PYTHON_DIR"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/Users/runner/work/CRPropa3/CRPropa3/build \
-DPython_EXECUTABLE=$PYTHON_DIR/bin/python$PYTHON_VERSION \
-DPython_LIBRARY=$PYTHON_DIR/lib/libpython$PYTHON_VERSION.dylib \
-DPython_INCLUDE_PATH=$PYTHON_DIR/include/python$PYTHON_VERSION \
-DCMAKE_C_COMPILER=$LLVM_DIR/bin/clang \
-DCMAKE_CXX_COMPILER=$LLVM_DIR/bin/clang++ \
-DOpenMP_CXX_FLAGS="-fopenmp -I${OMP_DIR}/include" \
-DOpenMP_C_FLAGS="-fopenmp =libomp -I$OMP_DIR/include" \
-DOpenMP_libomp_LIBRARY=$OMP_DIR/$OMP_VERSION/lib/libomp.dylib \
-DOpenMP_C_LIB_NAMES=libomp.dylib \
-DOpenMP_CXX_LIB_NAMES=libomp.dylib \
-DNO_TCMALLOC=TRUE \
-DPython_NumPy_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numpy/core/include
- name: Build CRPropa
run: |
cd build
make
- name: Run tests
env:
CRPROPA_DATA_PATH: "/Users/runner/work/CRPropa3/CRPropa3/build/data"
run: |
cd build
make test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4
with:
name: "test-report_${{matrix.config.name}}"
path: build/Testing/Temporary/LastTest.log