-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (128 loc) · 4.74 KB
/
build.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Build
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CMAKE_PREFIX_PATH: ${{ matrix.cmake_prefix_path }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.osx_target }}
PFFDTD_ENGINE_2D: ${{ matrix.pffdtd_engine_2d }}
PFFDTD_ENGINE_3D: ${{ matrix.pffdtd_engine_3d }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
osx_target: ""
cmake_prefix_path: "/opt/intel/oneapi/tbb/latest"
cmake_flags: ""
cxx_flags: ""
python_version: "3.12"
pffdtd_engine_2d: "build/src/cpp/main_2d/pffdtd_2d"
pffdtd_engine_3d: ""
- name: macOS-X64
os: macos-13
osx_target: "10.15"
cmake_prefix_path: ""
cmake_flags: '-D OpenMP_ROOT=`brew list libomp | grep libomp.a | sed -E "s/\/lib\/.*//"`'
cxx_flags: ""
python_version: "3.12"
pffdtd_engine_2d: "build/src/cpp/main_2d/pffdtd_2d"
pffdtd_engine_3d: ""
- name: macOS-ARM64
os: macos-14
osx_target: "11.0"
cmake_prefix_path: ""
cmake_flags: '-D OpenMP_ROOT=`brew list libomp | grep libomp.a | sed -E "s/\/lib\/.*//"`'
cxx_flags: ""
python_version: "3.12"
pffdtd_engine_2d: "build/src/cpp/main_2d/pffdtd_2d"
pffdtd_engine_3d: "build/src/cpp/main_3d/pffdtd_3d"
- name: Windows
os: windows-latest
osx_target: ""
cmake_prefix_path: C:\Program Files (x86)\Intel\oneAPI\tbb\latest
cmake_flags: ""
cxx_flags: ""
python_version: "3.12"
pffdtd_engine_2d: ""
pffdtd_engine_3d: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update -y
sudo apt install -y libomp-dev ninja-build
pip3 install --break-system-packages conan
- name: Install TBB (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update -y
sudo apt install -y intel-oneapi-tbb-devel
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install conan hdf5 libomp llvm ninja tbb
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
choco install ninja
pip3 install --upgrade conan
- name: Install TBB (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
curl --output oneapi.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_2024.2.1.101_offline.exe
./oneapi.exe -s -x -f oneapi
./oneapi/bootstrapper.exe -s -c --action install --components=intel.oneapi.win.tbb.devel --eula=accept -p=NEED_VS2022_INTEGRATION=1 --log-dir=.
- name: Install clang
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
- name: Set up Visual Studio shell
if: runner.os == 'Windows'
uses: egor-tensin/vs-shell@v2
- name: Setup conan
run: |
conan profile detect -f
git clone https://github.com/conan-io/cmake-conan.git -b develop2 external/cmake-conan
- name: CMake configure
run: >
cmake
-B build
-G Ninja
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
-D CMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake
${{ matrix.cmake_flags }}
- name: CMake build
run: cmake --build build
- name: PIP
run: pip3 install --verbose .[test]
- name: Pytest
run: pytest --cov=pffdtd --cov-branch
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true