From d07198f27800159e876f4ba45ee53f08a764431f Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 30 Jan 2024 11:04:05 +0100 Subject: [PATCH 1/2] Added Linux workflow --- .github/workflows/linux.yml | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..df814fb --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,98 @@ +name: Linux +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + build: + runs-on: ubuntu-20.04 + name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }} + strategy: + fail-fast: false + matrix: + sys: + - {compiler: gcc, version: '8'} + - {compiler: gcc, version: '9'} + - {compiler: gcc, version: '10'} + - {compiler: gcc, version: '11'} + - {compiler: clang, version: '15'} + - {compiler: clang, version: '16'} + + steps: + + - name: Setup GCC + if: ${{ matrix.sys.compiler == 'gcc' }} + run: | + GCC_VERSION=${{ matrix.sys.version }} + sudo apt-get update + sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION + CC=gcc-$GCC_VERSION + echo "CC=$CC" >> $GITHUB_ENV + CXX=g++-$GCC_VERSION + echo "CXX=$CXX" >> $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@v1 + with: + environment-file: environment-dev.yml + cache-environment: true + + - name: Configure using CMake + run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX $(Build.SourcesDirectory) + + - name: Install + working-directory: build + run: cmake --install . + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_r --parallel 8 + + - name: Install R package + working-directory: build + run: | + export TAR="/bin/tar" + R -e "library(devtools); install_github('xtensor-stack/Xtensor.R', configure.args = '--novendor')" + + - name: Run tests (C++) + working-directory: build/test + run: ./test_xtensor_r + + - name: Run tests (R) + working-directory: test + run: | + mkdir ~/.R + touch ~/.R/Makevars + echo "CXX14=$CXX" >> ~/.R/Makevars + echo "CXX14FLAGS=-fPIC -O2" >> ~/.R/Makevars + Rscript ./unittest.R + From b1a7f353c2156f8f969cb499e1859d19de097c43 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 30 Jan 2024 11:06:27 +0100 Subject: [PATCH 2/2] Removed Azure pipelines --- azure-pipelines.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 38a471d..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,9 +0,0 @@ -trigger: - - master - -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux-clang.yml - - template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml - -