Skip to content

Commit 00e773a

Browse files
authored
Merge pull request #239 from JohanMabille/gha
Switched CI to GHA
2 parents 5887b55 + cc0f63a commit 00e773a

File tree

7 files changed

+209
-8
lines changed

7 files changed

+209
-8
lines changed

.github/workflows/linux.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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.blas }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
sys:
21+
- {compiler: gcc, version: '8', blas: OpenBLAS}
22+
- {compiler: gcc, version: '8', blas: mkl}
23+
- {compiler: gcc, version: '9', blas: OpenBLAS}
24+
- {compiler: gcc, version: '9', blas: mkl}
25+
- {compiler: gcc, version: '10', blas: OpenBLAS}
26+
- {compiler: gcc, version: '10', blas: mkl}
27+
- {compiler: gcc, version: '11', blas: OpenBLAS}
28+
- {compiler: gcc, version: '11', blas: mkl}
29+
- {compiler: clang, version: '15', blas: OpenBLAS}
30+
- {compiler: clang, version: '15', blas: mkl}
31+
- {compiler: clang, version: '16', blas: OpenBLAS}
32+
- {compiler: clang, version: '16', blas: mkl}
33+
34+
steps:
35+
36+
- name: Setup GCC
37+
if: ${{ matrix.sys.compiler == 'gcc' }}
38+
run: |
39+
GCC_VERSION=${{ matrix.sys.version }}
40+
sudo apt-get update
41+
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
42+
CC=gcc-$GCC_VERSION
43+
echo "CC=$CC" >> $GITHUB_ENV
44+
CXX=g++-$GCC_VERSION
45+
echo "CXX=$CXX" >> $GITHUB_ENV
46+
47+
- name: Setup clang
48+
if: ${{ matrix.sys.compiler == 'clang' }}
49+
run: |
50+
LLVM_VERSION=${{ matrix.sys.version }}
51+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
52+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || 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+
73+
- name: Install mkl
74+
if: ${{ matrix.sys.blas == 'mkl' }}
75+
run: micromamba install mkl
76+
77+
- name: Install OpenBLAS
78+
if: ${{ matrix.sys.blas == 'OpenBLAS' }}
79+
run: micromamba install openblas==0.3 blas-devel
80+
81+
- name: Configure using CMake
82+
run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
83+
84+
- name: Build
85+
working-directory: build
86+
run: cmake --build . --target test_xtensor_blas --parallel 8
87+
88+
- name: Run tests
89+
working-directory: build/test
90+
run: ./test_xtensor_blas

.github/workflows/osx.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 }} - mkl
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: Install mkl
38+
run: micromamba install mkl
39+
40+
- name: Configure using CMake
41+
run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
42+
43+
- name: Build
44+
working-directory: build
45+
run: cmake --build . --target test_xtensor_blas --parallel 8
46+
47+
- name: Run tests
48+
working-directory: build/test
49+
run: ./test_xtensor_blas

.github/workflows/windows.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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: Install mkl
51+
run: micromamba install mkl-devel
52+
53+
- name: Configure using CMake
54+
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON -G Ninja
55+
56+
- name: Build
57+
working-directory: build
58+
run: cmake --build . --target test_xtensor_blas --parallel 8
59+
60+
- name: Run tests
61+
working-directory: build/test
62+
run: ./test_xtensor_blas

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.8)
1111
project(xtensor-blas)
1212

1313
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

azure-pipelines.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ trigger:
22
- master
33

44
jobs:
5-
- template: ./.azure-pipelines/azure-pipelines-win.yml
6-
- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml
7-
- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml
8-
- template: ./.azure-pipelines/azure-pipelines-osx.yml
5+
#- template: ./.azure-pipelines/azure-pipelines-win.yml
6+
#- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml
7+
#- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml
8+
#- template: ./.azure-pipelines/azure-pipelines-osx.yml

readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22

33
build:
4-
os: "ubuntu-22.04"
4+
os: ubuntu-22.04
55
tools:
6-
python: "mambaforge-22.9"
6+
python: mambaforge-22.9
77

88
conda:
99
environment: docs/environment.yml

test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.8)
1111

1212
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
1313
project(xtensor-blas-test)

0 commit comments

Comments
 (0)