From 4b50cb8685cd73e796da9bc3e501b8f8bc921d44 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Sat, 10 Feb 2024 07:42:48 +0100 Subject: [PATCH] Added linux workflow --- .github/workflows/linux.yml | 71 +++++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 8 ++--- 2 files changed, 75 insertions(+), 4 deletions(-) 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..944c2cf --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,71 @@ +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 }} - ${{ matrix.sys.blas }} + strategy: + fail-fast: false + matrix: + sys: + - { compiler: gcc, verion: '8', blas: OpenBLAS } + - { compiler: gcc, verion: '8', blas: mkl} + - { compiler: gcc, verion: '9', blas: OpenBLAS } + - { compiler: gcc, verion: '9', blas: mkl} + - { compiler: gcc, verion: '10', blas: OpenBLAS } + - { compiler: gcc, verion: '10', blas: mkl} + - { compiler: gcc, verion: '11', blas: OpenBLAS } + - { compiler: gcc, verion: '11', blas: mkl} + + 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: 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: Install mkl + if: ${{ matrix.sys.blas == 'mkl' }} + run: micromamba install mkl + + - name: Install OpenBLAS + if: ${{ matrix.sys.blas == 'OpenBLAS' }} + run: micromamba install openblas==0.3 blas-devel + + - name: Configure using CMake + 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 + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_blas --parallel 8 + + - name: Run tests + working-directory: build/test + run: ./test_xtensor_blas diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 29081a9..b6bd8be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ trigger: - master jobs: -- template: ./.azure-pipelines/azure-pipelines-win.yml -- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml -- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml -- template: ./.azure-pipelines/azure-pipelines-osx.yml + #- template: ./.azure-pipelines/azure-pipelines-win.yml + #- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml + #- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml + #- template: ./.azure-pipelines/azure-pipelines-osx.yml