forked from xtensor-stack/xtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (147 loc) · 5.45 KB
/
ci.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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [master]
jobs:
linux:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest]
sys:
- {compiler: gcc, version: '11', name: c++17, flags: -DCPP17=ON}
- {compiler: clang, version: '15', name: assert, flags: -DXTENSOR_ENABLE_ASSERT=ON}
- {compiler: clang, version: '16', name: column-major, flags: -DDEFAULT_COLUMN_MAJOR=ON}
- {compiler: default, version: '', name: tbb, flags: -DXTENSOR_USE_TBB=ON -DTBB_INCLUDE_DIR=$CONDA_PREFIX/include -DTBB_LIBRARY=$CONDA_PREFIX/lib}
- {compiler: default, version: '', name: openmp, flags: -DXTENSOR_USE_OPENMP=ON}
- {compiler: default, version: '', name: noexcept, flags: -DXTENSOR_DISABLE_EXCEPTIONS=ON}
- {compiler: default, version: '', name: xsimd, flags: -DXTENSOR_USE_XSIMD=ON}
- {compiler: default, version: '', name: xsimd-tbb, flags: -DXTENSOR_USE_XSIMD=ON -DXTENSOR_USE_TBB=ON}
defaults:
run:
shell: bash -e -l {0}
name: ${{ matrix.runs-on }} • ${{ matrix.sys.compiler }}${{ matrix.sys.version }} - ${{ matrix.sys.name }}
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup GCC
if: ${{ matrix.sys.compiler == 'gcc' }}
run: |
echo "CC=gcc-${{ matrix.sys.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.sys.version }}" >> $GITHUB_ENV
- name: Setup clang
if: ${{ matrix.sys.compiler == 'clang' }}
run: |
LLVM_VERSION=${{ matrix.sys.version }}
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
if [[ $LLVM_VERSION -ge 13 ]]; then
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
else
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
fi || exit 1
sudo apt-get update || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
sudo ln -s /usr/include/asm-generic /usr/include/asm
CC=clang-$LLVM_VERSION
echo "CC=$CC" >> $GITHUB_ENV
CXX=clang++-$LLVM_VERSION
echo "CXX=$CXX" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Set conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-name: myenv
environment-file: environment-dev.yml
init-shell: bash
cache-downloads: true
create-args: |
${{ (matrix.sys.name == 'tbb' || matrix.sys.name == 'xsimd-tbb' ) && 'tbb-devel' || '' }}
- name: Configure using CMake
run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON ${{ matrix.sys.flags }}
- name: Install
working-directory: build
run: cmake --install .
- name: Build
working-directory: build
run: cmake --build . --target test_xtensor_lib --parallel 8
- name: Run tests
working-directory: build
run: ctest -R ^xtest$ --output-on-failure
macos:
strategy:
fail-fast: false
matrix:
runs-on: [macos-latest]
defaults:
run:
shell: bash -e -l {0}
name: ${{ matrix.runs-on }} • default - default
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-name: myenv
environment-file: environment-dev.yml
init-shell: bash
cache-downloads: true
- name: Configure using CMake
run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON
- name: Install
working-directory: build
run: cmake --install .
- name: Build
working-directory: build
run: cmake --build . --target test_xtensor_lib --parallel 8
- name: Run tests
working-directory: build
run: ctest -R ^xtest$ --output-on-failure
windows:
strategy:
fail-fast: false
matrix:
runs-on: [windows-latest]
sys:
- {compiler: default}
- {compiler: clang}
defaults:
run:
shell: bash -e -l {0}
name: ${{ matrix.runs-on }} • ${{ matrix.sys.compiler }} - default
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup MSVC
if: matrix.sys.compiler == 'default'
uses: ilammy/msvc-dev-cmd@v1
- name: Setup clang
if: matrix.sys.compiler == 'clang'
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Set conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-name: myenv
environment-file: environment-dev.yml
init-shell: bash
cache-downloads: true
create-args: |
ninja
- name: Configure using CMake
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON -G Ninja
- name: Install
working-directory: build
run: cmake --install .
- name: Build
working-directory: build
run: cmake --build . --target test_xtensor_lib --parallel 8
- name: Run tests
working-directory: build
run: ctest -R ^xtest$ --output-on-failure