|
| 1 | +name: OSX |
| 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 | +defaults: |
| 11 | + run: |
| 12 | + shell: bash -e -l {0} |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + runs-on: macos-${{ matrix.os }} |
| 16 | + name: macos-${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + os: |
| 21 | + - 11 |
| 22 | + - 12 |
| 23 | + |
| 24 | + steps: |
| 25 | + |
| 26 | + - name: Checkout code |
| 27 | + uses: actions/checkout@v3 |
| 28 | + |
| 29 | + - name: Set conda environment |
| 30 | + uses: mamba-org/setup-micromamba@v1 |
| 31 | + with: |
| 32 | + environment-file: environment-dev.yml |
| 33 | + cache-environment: true |
| 34 | + |
| 35 | + - name: Configure using CMake |
| 36 | + run: cmake -G Ninja -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DPYTHON_EXECUTABLE=`which python` -DDOWNLOAD_GTEST=ON $(Build.SourcesDirectory) |
| 37 | + |
| 38 | + - name: Install |
| 39 | + working-directory: build |
| 40 | + run: cmake --install . |
| 41 | + |
| 42 | + - name: Build |
| 43 | + working-directory: build |
| 44 | + run: cmake --build . --target test_xtensor_python --parallel 8 |
| 45 | + |
| 46 | + - name: Run tests (C++) |
| 47 | + working-directory: build/test |
| 48 | + run: ./test_xtensor_python |
| 49 | + |
| 50 | + - name: Run tests (Python) |
| 51 | + run: pytest -s |
| 52 | + |
| 53 | + - name: Example - readme 1 |
| 54 | + working-directory: docs/source/examples/readme_example_1 |
| 55 | + run: | |
| 56 | + cmake -Bbuild -DPython_EXECUTABLE=`which python` |
| 57 | + cd build |
| 58 | + cmake --build . |
| 59 | + cp ../example.py . |
| 60 | + python example.py |
| 61 | +
|
| 62 | + - name: Example - copy \'cast\' |
| 63 | + working-directory: docs/source/examples/copy_cast |
| 64 | + run: | |
| 65 | + cmake -Bbuild -DPython_EXECUTABLE=`which python` |
| 66 | + cd build |
| 67 | + cmake --build . |
| 68 | + cp ../example.py . |
| 69 | + python example.py |
| 70 | +
|
| 71 | + - name: Example - SFINAE |
| 72 | + working-directory: docs/source/examples/sfinae |
| 73 | + run: | |
| 74 | + cmake -Bbuild -DPython_EXECUTABLE=`which python` |
| 75 | + cd build |
| 76 | + cmake --build . |
| 77 | + cp ../example.py . |
| 78 | + python example.py |
0 commit comments