|
| 1 | + |
| 2 | +name: Test |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +concurrency: |
| 6 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 7 | + cancel-in-progress: true |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: ${{ matrix.os }} with BUILD_SHARED_LIBS=${{matrix.shared}} |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + os: [macos-latest, windows-latest, ubuntu-latest] |
| 16 | + shared: [ON, OFF] |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 21 | + if: matrix.os == 'windows-latest' |
| 22 | + - name: Support longpaths |
| 23 | + run: git config --system core.longpaths true |
| 24 | + if: matrix.os == 'windows-latest' |
| 25 | + - uses: mamba-org/setup-micromamba@v2 |
| 26 | + with: |
| 27 | + init-shell: bash |
| 28 | + environment-file: .github/environment.yml |
| 29 | + environment-name: "build" |
| 30 | + |
| 31 | + - name: Setup |
| 32 | + shell: bash -l {0} |
| 33 | + run: | |
| 34 | + mkdir build |
| 35 | +
|
| 36 | + - name: CMake |
| 37 | + shell: bash -l {0} |
| 38 | + env: |
| 39 | + BUILD_SHARED_LIBS: ${{ matrix.shared }} |
| 40 | + |
| 41 | + run: | |
| 42 | +
|
| 43 | + if [ "$RUNNER_OS" == "Windows" ]; then |
| 44 | + export CC=cl.exe |
| 45 | + export CXX=cl.exe |
| 46 | + fi |
| 47 | +
|
| 48 | + cmake -G "Ninja" \ |
| 49 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 50 | + -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \ |
| 51 | + -DBUILD_TESTING=ON \ |
| 52 | + -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ |
| 53 | + .. |
| 54 | +
|
| 55 | +
|
| 56 | + working-directory: ./build |
| 57 | + |
| 58 | + - name: Compile |
| 59 | + shell: bash -l {0} |
| 60 | + run: | |
| 61 | + ninja |
| 62 | + working-directory: ./build |
| 63 | + |
| 64 | + - name: Install |
| 65 | + shell: bash -l {0} |
| 66 | + run: | |
| 67 | + ninja install |
| 68 | + working-directory: ./build |
| 69 | + |
| 70 | + - name: "There are no tests :spoon:" |
| 71 | + shell: bash -l {0} |
| 72 | + run: | |
| 73 | + echo "There are no tests" |
| 74 | + working-directory: ./build |
| 75 | + |
0 commit comments