forked from grimme-lab/mstore
-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (158 loc) · 5.01 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: CI
on:
push:
paths-ignore:
- "docs/**"
- "*.md"
- "*.rst"
- ".*"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
- "*.rst"
- ".*"
workflow_dispatch:
env:
M_BUILD_DIR: _build_meson
C_BUILD_DIR: _build_cmake
jobs:
gcc-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
env:
FC: gfortran
GCC_V: 10
PYTHON_V: 3.8
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python version ${{ env.PYTHON_V }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_V }}
- name: Install GCC (OSX)
if: contains(matrix.os, 'macos')
run: |
brew install gcc@${{ env.GCC_V }}
ln -s /usr/local/bin/gfortran-${{ env.GCC_V }} /usr/local/bin/gfortran
ln -s /usr/local/bin/gcc-${{ env.GCC_V }} /usr/local/bin/gcc
ln -s /usr/local/bin/g++-${{ env.GCC_V }} /usr/local/bin/g++
which gfortran
- name: Install GCC (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: Install meson/cmake
run: pip3 install meson==0.57.2 ninja cmake
- name: Configure meson build
run: meson setup ${{ env.M_BUILD_DIR }}
- name: Build library (meson)
run: meson compile -C ${{ env.M_BUILD_DIR }}
- name: Run unit tests (meson)
run: meson test -C ${{ env.M_BUILD_DIR }} --print-errorlogs --no-rebuild
- name: Configure CMake build
run: cmake -B ${{ env.C_BUILD_DIR }} -G Ninja
- name: Build library (CMake)
run: cmake --build ${{ env.C_BUILD_DIR }}
- name: Run unit tests (CTest)
run: ctest
working-directory: ${{ env.C_BUILD_DIR }}
# Test native MinGW Windows build
mingw-build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 },
# { msystem: MINGW32, arch: i686 }
]
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup MSYS2 toolchain
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: >-
git
mingw-w64-${{ matrix.arch }}-gcc-fortran
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-ninja
- name: Install meson/cmake
run: pip3 install meson==0.56.2
- name: Configure meson build
run: meson setup ${{ env.M_BUILD_DIR }}
env:
FC: gfortran
LDFLAGS: -Wl,--allow-multiple-definition
- name: Build project (meson)
run: meson compile -C ${{ env.M_BUILD_DIR }}
- name: Run unit tests (meson)
run: meson test -C ${{ env.M_BUILD_DIR }} --print-errorlogs --no-rebuild
env:
OMP_NUM_THREADS: 2,1
- name: Configure cmake build
run: cmake -B ${{ env.C_BUILD_DIR }} -G Ninja
- name: Build project (CMake)
run: cmake --build ${{ env.C_BUILD_DIR }}
- name: Run unit tests (CTest)
run: ctest
working-directory: ${{ env.C_BUILD_DIR }}
env:
OMP_NUM_THREADS: 2,1
intel-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
env:
FC: ifort
OMP_NUM_THREADS: 2,1
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
run: |
sudo apt-get install intel-oneapi-compiler-fortran
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install meson/cmake
run: pip3 install meson==0.56.2 ninja cmake
- name: Configure meson build
run: meson setup ${{ env.M_BUILD_DIR }}
- name: Build library (meson)
run: meson compile -C ${{ env.M_BUILD_DIR }}
- name: Run unit tests (meson)
run: meson test -C ${{ env.M_BUILD_DIR }} --print-errorlogs --no-rebuild
- name: Configure cmake build
run: cmake -B ${{ env.C_BUILD_DIR }} -G Ninja
- name: Build library (CMake)
run: cmake --build ${{ env.C_BUILD_DIR }}
- name: Run unit tests (CTest)
run: ctest
working-directory: ${{ env.C_BUILD_DIR }}