Skip to content

Commit b2e8176

Browse files
authored
Merge pull request #139 from JohanMabille/gha_ci
Added Linux workflow
2 parents 0a05203 + b1a7f35 commit b2e8176

File tree

2 files changed

+98
-9
lines changed

2 files changed

+98
-9
lines changed

.github/workflows/linux.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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 }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
sys:
21+
- {compiler: gcc, version: '8'}
22+
- {compiler: gcc, version: '9'}
23+
- {compiler: gcc, version: '10'}
24+
- {compiler: gcc, version: '11'}
25+
- {compiler: clang, version: '15'}
26+
- {compiler: clang, version: '16'}
27+
28+
steps:
29+
30+
- name: Setup GCC
31+
if: ${{ matrix.sys.compiler == 'gcc' }}
32+
run: |
33+
GCC_VERSION=${{ matrix.sys.version }}
34+
sudo apt-get update
35+
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
36+
CC=gcc-$GCC_VERSION
37+
echo "CC=$CC" >> $GITHUB_ENV
38+
CXX=g++-$GCC_VERSION
39+
echo "CXX=$CXX" >> $GITHUB_ENV
40+
41+
- name: Setup clang
42+
if: ${{ matrix.sys.compiler == 'clang' }}
43+
run: |
44+
LLVM_VERSION=${{ matrix.sys.version }}
45+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
46+
if [[ $LLVM_VERSION -ge 13 ]]; then
47+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
48+
else
49+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
50+
fi || exit 1
51+
sudo apt-get update || exit 1
52+
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
53+
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
54+
sudo ln -s /usr/include/asm-generic /usr/include/asm
55+
CC=clang-$LLVM_VERSION
56+
echo "CC=$CC" >> $GITHUB_ENV
57+
CXX=clang++-$LLVM_VERSION
58+
echo "CXX=$CXX" >> $GITHUB_ENV
59+
60+
- name: Checkout code
61+
uses: actions/checkout@v3
62+
63+
- name: Set conda environment
64+
uses: mamba-org/setup-micromamba@v1
65+
with:
66+
environment-file: environment-dev.yml
67+
cache-environment: true
68+
69+
- name: Configure using CMake
70+
run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX $(Build.SourcesDirectory)
71+
72+
- name: Install
73+
working-directory: build
74+
run: cmake --install .
75+
76+
- name: Build
77+
working-directory: build
78+
run: cmake --build . --target test_xtensor_r --parallel 8
79+
80+
- name: Install R package
81+
working-directory: build
82+
run: |
83+
export TAR="/bin/tar"
84+
R -e "library(devtools); install_github('xtensor-stack/Xtensor.R', configure.args = '--novendor')"
85+
86+
- name: Run tests (C++)
87+
working-directory: build/test
88+
run: ./test_xtensor_r
89+
90+
- name: Run tests (R)
91+
working-directory: test
92+
run: |
93+
mkdir ~/.R
94+
touch ~/.R/Makevars
95+
echo "CXX14=$CXX" >> ~/.R/Makevars
96+
echo "CXX14FLAGS=-fPIC -O2" >> ~/.R/Makevars
97+
Rscript ./unittest.R
98+

azure-pipelines.yml

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

0 commit comments

Comments
 (0)