-
Notifications
You must be signed in to change notification settings - Fork 25
101 lines (84 loc) · 3 KB
/
cmake_macos.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
name: CMake MacOS
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-12, macos-13, macos-latest]
include:
- os: macos-12
dylib_path: /usr/local/lib/gcc/current
- os: macos-13
dylib_path: /usr/local/lib/gcc/current
- os: macos-latest # https://github.com/actions/runner/issues/3337
dylib_path: /opt/homebrew/Cellar/gcc/14.2.0/lib/gcc/current
steps:
- name: Build Info
run: |
uname -a
gcc -v
clang -v
- name: CCache
id: cache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('hashFile.txt') }}
restore-keys: ${{ runner.os }}-ccache-
- name: Cache PIP (OSX)
uses: actions/cache@v3
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Clone PHARE
uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-python@v4
with:
python-version: '3.12.3'
- name: Install system deps (openmpi, hdf5, ccache,...)
run: |
brew reinstall gcc
brew install open-mpi hdf5-mpi ccache
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
- name: Ensure ccache uses ~/.ccache
run: |
mkdir -p ~/.ccache
ccache --set-config=cache_dir=~/.ccache
ccache --get-config=cache_dir
- name: Install python deps
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
env:
LIBRARY_PATH: ${{ matrix.dylib_path }} # used by clang, needed to find libquadmath - else link error
run: |
[ -d /opt/homebrew/Cellar/gcc ] && ls -l /opt/homebrew/Cellar/gcc
[ ! -d "${{matrix.dylib_path}}" ] && echo dylib_path not found && find / -name "libquadmath.0.dylib" && exit 1
cmake $GITHUB_WORKSPACE -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_SAMRAI_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DlowResourceTests=ON \
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 "
- name: Build
working-directory: ${{runner.workspace}}/build
env:
LIBRARY_PATH: ${{ matrix.dylib_path }} # used by clang, needed to find libquadmath - else link error
run: cmake --build . -j 2
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -j 2 --output-on-failure