Skip to content

Commit d7f2ffc

Browse files
authored
Merge pull request #2767 from JohanMabille/ci
Added more compilers
2 parents f268c6d + c6c5493 commit d7f2ffc

File tree

5 files changed

+205
-183
lines changed

5 files changed

+205
-183
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 183 deletions
This file was deleted.

.github/workflows/linux.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Linux
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
defaults:
11+
run:
12+
shell: bash -e -l {0}
13+
jobs:
14+
build:
15+
runs-on: ubuntu-20.04
16+
name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }} - ${{ matrix.sys.name }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
sys:
21+
- {compiler: clang, version: '15', name: assert, flags: -DXTENSOR_ENABLE_ASSERT=ON}
22+
- {compiler: clang, version: '16', name: column-major, flags: -DDEFAULT_COLUMN_MAJOR=ON}
23+
- {compiler: gcc, version: '8', name: openmp, flags: -DXTENSOR_USE_OPENMP=ON}
24+
- {compiler: gcc, version: '9', name: noexcept, flags: -DXTENSOR_DISABLE_EXCEPTIONS=ON}
25+
- {compiler: gcc, version: '10', name: xsimd, flags: -DXTENSOR_USE_XSIMD=ON}
26+
- {compiler: gcc, version: '11', name: c++17, flags: -DCPP17=ON}
27+
- {compiler: gcc, version: '11', name: xsimd-tbb, flags: -DXTENSOR_USE_XSIMD=ON -DXTENSOR_USE_TBB=ON}
28+
- {compiler: gcc, version: '11', name: tbb, flags: -DXTENSOR_USE_TBB=ON -DTBB_INCLUDE_DIR=$CONDA_PREFIX/include -DTBB_LIBRARY=$CONDA_PREFIX/lib}
29+
30+
steps:
31+
32+
- name: Setup GCC
33+
if: ${{ matrix.sys.compiler == 'gcc' }}
34+
run: |
35+
GCC_VERSION=${{ matrix.sys.version }}
36+
sudo apt-get update
37+
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
38+
CC=gcc-$GCC_VERSION
39+
echo "CC=$CC" >> $GITHUB_ENV
40+
CXX=g++-$GCC_VERSION
41+
echo "CXX=$CXX" >> $GITHUB_ENV
42+
43+
- name: Setup clang
44+
if: ${{ matrix.sys.compiler == 'clang' }}
45+
run: |
46+
LLVM_VERSION=${{ matrix.sys.version }}
47+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
48+
if [[ $LLVM_VERSION -ge 13 ]]; then
49+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
50+
else
51+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
52+
fi || exit 1
53+
sudo apt-get update || exit 1
54+
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
55+
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
56+
sudo ln -s /usr/include/asm-generic /usr/include/asm
57+
CC=clang-$LLVM_VERSION
58+
echo "CC=$CC" >> $GITHUB_ENV
59+
CXX=clang++-$LLVM_VERSION
60+
echo "CXX=$CXX" >> $GITHUB_ENV
61+
62+
- name: Checkout code
63+
uses: actions/checkout@v3
64+
65+
- name: Set conda environment
66+
uses: mamba-org/setup-micromamba@main
67+
with:
68+
environment-name: myenv
69+
environment-file: environment-dev.yml
70+
init-shell: bash
71+
cache-downloads: true
72+
create-args: |
73+
${{ (matrix.sys.name == 'tbb' || matrix.sys.name == 'xsimd-tbb' ) && 'tbb-devel' || '' }}
74+
75+
- name: Configure using CMake
76+
# env:
77+
# CC: ${{ env.CC }}
78+
# CXX: ${{ env.CXX }}
79+
run: cmake -G Ninja -Bbuild -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON ${{ matrix.sys.flags }}
80+
81+
- name: Install
82+
working-directory: build
83+
run: cmake --install .
84+
85+
- name: Build
86+
working-directory: build
87+
run: cmake --build . --target test_xtensor_lib --parallel 8
88+
89+
- name: Run tests
90+
working-directory: build
91+
run: ctest -R ^xtest$ --output-on-failure

.github/workflows/osx.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: OSX
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
defaults:
11+
run:
12+
shell: bash -e -l {0}
13+
jobs:
14+
build:
15+
runs-on: macos-${{ matrix.os }}
16+
name: macos-${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os:
21+
- 11
22+
- 12
23+
24+
steps:
25+
26+
- name: Checkout code
27+
uses: actions/checkout@v3
28+
29+
- name: Set conda environment
30+
uses: mamba-org/setup-micromamba@main
31+
with:
32+
environment-name: myenv
33+
environment-file: environment-dev.yml
34+
init-shell: bash
35+
cache-downloads: true
36+
37+
- name: Configure using CMake
38+
run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON
39+
40+
- name: Install
41+
working-directory: build
42+
run: cmake --install .
43+
44+
- name: Build
45+
working-directory: build
46+
run: cmake --build . --target test_xtensor_lib --parallel 8
47+
48+
- name: Run tests
49+
working-directory: build
50+
run: ctest -R ^xtest$ --output-on-failure

.github/workflows/windows.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Windows
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
defaults:
11+
run:
12+
shell: bash -e -l {0}
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.runs-on }}
16+
name: ${{ matrix.sys.compiler }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
runs-on: [windows-latest]
21+
sys:
22+
- {compiler: default}
23+
- {compiler: clang}
24+
25+
steps:
26+
27+
- name: Setup MSVC
28+
if: matrix.sys.compiler == 'default'
29+
uses: ilammy/msvc-dev-cmd@v1
30+
31+
- name: Setup clang
32+
if: matrix.sys.compiler == 'clang'
33+
run: |
34+
echo "CC=clang" >> $GITHUB_ENV
35+
echo "CXX=clang++" >> $GITHUB_ENV
36+
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
40+
- name: Set conda environment
41+
uses: mamba-org/setup-micromamba@main
42+
with:
43+
environment-name: myenv
44+
environment-file: environment-dev.yml
45+
init-shell: bash
46+
cache-downloads: true
47+
create-args: |
48+
ninja
49+
50+
- name: Configure using CMake
51+
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON -G Ninja
52+
53+
- name: Install
54+
working-directory: build
55+
run: cmake --install .
56+
57+
- name: Build
58+
working-directory: build
59+
run: cmake --build . --target test_xtensor_lib --parallel 8
60+
61+
- name: Run tests
62+
working-directory: build
63+
run: ctest -R ^xtest$ --output-on-failure

environment-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ dependencies:
88
- nlohmann_json
99
- doctest=2.4.7
1010
- pre-commit
11+
- ninja

0 commit comments

Comments
 (0)