|
| 1 | +name: CI |
| 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 | +permissions: |
| 11 | + contents: read |
| 12 | +defaults: |
| 13 | + run: |
| 14 | + shell: bash -e -l {0} |
| 15 | +jobs: |
| 16 | + build-and-test: |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + name: ${{ matrix.name }} |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + include: |
| 23 | + - os: ubuntu-latest |
| 24 | + name: Linux |
| 25 | + extra-cmake-args: "" |
| 26 | + - os: ubuntu-latest |
| 27 | + name: Linux (no exceptions) |
| 28 | + extra-cmake-args: "-DDISABLE_EXCEPTIONS=ON" |
| 29 | + - os: macos-latest |
| 30 | + name: macOS arm |
| 31 | + extra-cmake-args: "" |
| 32 | + - os: macos-26-intel |
| 33 | + name: macOS intel |
| 34 | + extra-cmake-args: "" |
| 35 | + - os: windows-latest |
| 36 | + name: Windows |
| 37 | + extra-cmake-args: "-DCMAKE_BUILD_TYPE=Release" |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Setup MSVC |
| 41 | + if: matrix.os == 'windows-latest' |
| 42 | + uses: ilammy/msvc-dev-cmd@v1 |
| 43 | + |
| 44 | + - name: Checkout code |
| 45 | + uses: actions/checkout@v7 |
| 46 | + |
| 47 | + - name: Set conda environment |
| 48 | + uses: mamba-org/setup-micromamba@v3 |
| 49 | + with: |
| 50 | + environment-name: xtensor-fftw |
| 51 | + init-shell: bash |
| 52 | + cache-downloads: true |
| 53 | + condarc: | |
| 54 | + channels: |
| 55 | + - conda-forge |
| 56 | + channel_priority: strict |
| 57 | + create-args: >- |
| 58 | + cmake |
| 59 | + ninja |
| 60 | + xtl |
| 61 | + xtensor |
| 62 | + fftw |
| 63 | + gtest |
| 64 | +
|
| 65 | + - name: Configure using CMake |
| 66 | + run: cmake -G Ninja -Bbuild -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX ${{ matrix.extra-cmake-args }} |
| 67 | + |
| 68 | + - name: Build |
| 69 | + working-directory: build |
| 70 | + run: cmake --build . --target test_xtensor-fftw --parallel 2 |
| 71 | + |
| 72 | + - name: Run tests (Unix) |
| 73 | + if: matrix.os != 'windows-latest' |
| 74 | + working-directory: build/test |
| 75 | + run: ./test_xtensor-fftw |
| 76 | + |
| 77 | + - name: Run tests (Windows) |
| 78 | + if: matrix.os == 'windows-latest' |
| 79 | + working-directory: build/test |
| 80 | + run: ./test_xtensor-fftw.exe |
0 commit comments