diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 749307808..c87df8d70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: jobs: + linux: strategy: @@ -18,12 +19,17 @@ jobs: - {compiler: gcc, version: '11', name: c++17, flags: -DCPP17=ON} - {compiler: clang, version: '15', name: assert, flags: -DXTENSOR_ENABLE_ASSERT=ON} - {compiler: clang, version: '16', name: column-major, flags: -DDEFAULT_COLUMN_MAJOR=ON} + - {compiler: default, version: '', name: tbb, flags: -DXTENSOR_USE_TBB=ON -DTBB_INCLUDE_DIR=$CONDA_PREFIX/include -DTBB_LIBRARY=$CONDA_PREFIX/lib} + - {compiler: default, version: '', name: openmp, flags: -DXTENSOR_USE_OPENMP=ON} + - {compiler: default, version: '', name: noexcept, flags: -DXTENSOR_DISABLE_EXCEPTIONS=ON} + - {compiler: default, version: '', name: xsimd, flags: -DXTENSOR_USE_XSIMD=ON} + - {compiler: default, version: '', name: xsimd-tbb, flags: -DXTENSOR_USE_XSIMD=ON -DXTENSOR_USE_TBB=ON} defaults: run: - shell: bash -l {0} + shell: bash -e -l {0} - name: ${{ matrix.runs-on }} • ${{ matrix.sys.compiler }} ${{ matrix.sys.version }} - ${{ matrix.sys.name }} + name: ${{ matrix.runs-on }} • ${{ matrix.sys.compiler }}${{ matrix.sys.version }} - ${{ matrix.sys.name }} runs-on: ${{ matrix.runs-on }} steps: @@ -56,10 +62,14 @@ jobs: uses: actions/checkout@v3 - name: Set conda environment - uses: mamba-org/provision-with-micromamba@main + uses: mamba-org/setup-micromamba@main with: environment-name: myenv environment-file: environment-dev.yml + init-shell: bash + cache-downloads: true + create-args: | + ${{ (matrix.sys.name == 'tbb' || matrix.sys.name == 'xsimd-tbb' ) && 'tbb-devel' || '' }} - name: Configure using CMake run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON ${{ matrix.sys.flags }} @@ -76,43 +86,90 @@ jobs: working-directory: build run: ctest -R ^xtest$ --output-on-failure - default: + + macos: strategy: fail-fast: false matrix: - runs-on: [macos-latest, windows-latest] + runs-on: [macos-latest] defaults: run: - shell: bash -l {0} + shell: bash -e -l {0} name: ${{ matrix.runs-on }} • default - default runs-on: ${{ matrix.runs-on }} steps: - - name: Setup MSVC - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout code uses: actions/checkout@v3 - name: Set conda environment - uses: mamba-org/provision-with-micromamba@main + uses: mamba-org/setup-micromamba@main with: environment-name: myenv environment-file: environment-dev.yml - extra-specs: | - sel(win): ninja - sel(win): tbb-devel + init-shell: bash + cache-downloads: true - name: Configure using CMake - if: runner.os != 'Windows' run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON + - name: Install + working-directory: build + run: cmake --install . + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_lib --parallel 8 + + - name: Run tests + working-directory: build + run: ctest -R ^xtest$ --output-on-failure + + windows: + + strategy: + fail-fast: false + matrix: + runs-on: [windows-latest] + sys: + - {compiler: default} + - {compiler: clang} + + defaults: + run: + shell: bash -e -l {0} + + name: ${{ matrix.runs-on }} • ${{ matrix.sys.compiler }} - default + runs-on: ${{ matrix.runs-on }} + steps: + + - name: Setup MSVC + if: matrix.sys.compiler == 'default' + uses: ilammy/msvc-dev-cmd@v1 + + - name: Setup clang + if: matrix.sys.compiler == 'clang' + run: | + echo "CC=clang" >> $GITHUB_ENV + echo "CXX=clang++" >> $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 + create-args: | + ninja + - name: Configure using CMake - if: runner.os == 'Windows' run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON -G Ninja - name: Install diff --git a/.github/workflows/ci_extended.yaml b/.github/workflows/ci_extended.yaml deleted file mode 100644 index 6fc2e0d5f..000000000 --- a/.github/workflows/ci_extended.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: Extra CI - -on: - workflow_dispatch: - pull_request: - push: - branches: [master] - -jobs: - - linux: - - strategy: - fail-fast: false - matrix: - runs-on: [ubuntu-latest] - sys: - - {name: tbb, flags: -DXTENSOR_USE_TBB=ON -DTBB_INCLUDE_DIR=$CONDA_PREFIX/include -DTBB_LIBRARY=$CONDA_PREFIX/lib} - - {name: openmp, flags: -DXTENSOR_USE_OPENMP=ON} - - {name: noexcept, flags: -DXTENSOR_DISABLE_EXCEPTIONS=ON} - - {name: xsimd, flags: -DXTENSOR_USE_XSIMD=ON} - - {name: xsimd-tbb, flags: -DXTENSOR_USE_XSIMD=ON -DXTENSOR_USE_TBB=ON} - - - defaults: - run: - shell: bash -l {0} - - name: ${{ matrix.runs-on }} • default - ${{ matrix.sys.name }} - runs-on: ${{ matrix.runs-on }} - steps: - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set conda environment - uses: mamba-org/provision-with-micromamba@main - with: - environment-name: myenv - environment-file: environment-dev.yml - extra-specs: | - tbb-devel - - - name: Configure using CMake - run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON ${{ matrix.sys.flags }} - - - name: Install - working-directory: build - run: cmake --install . - - - name: Build - working-directory: build - run: cmake --build . --target test_xtensor_lib --parallel 8 - - - name: Run tests - working-directory: build - run: ctest -R ^xtest$ --output-on-failure - - clang: - - strategy: - fail-fast: false - matrix: - runs-on: [windows-latest] - - defaults: - run: - shell: bash -l {0} - - name: ${{ matrix.runs-on }} • clang - default - runs-on: ${{ matrix.runs-on }} - steps: - - - name: Setup clang - run: | - echo "CC=clang" >> $GITHUB_ENV - echo "CXX=clang++" >> $GITHUB_ENV - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set conda environment - uses: mamba-org/provision-with-micromamba@main - with: - environment-name: myenv - environment-file: environment-dev.yml - extra-specs: | - sel(win): ninja - - - name: Configure using CMake - run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON -G Ninja ${{ matrix.sys.flags }} - - - name: Install - working-directory: build - run: cmake --install . - - - name: Build - working-directory: build - run: cmake --build . --target test_xtensor_lib --parallel 8 - - - name: Run tests - working-directory: build - run: ctest -R ^xtest$ --output-on-failure