|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + |
| 10 | +jobs: |
| 11 | + |
| 12 | + standard: |
| 13 | + |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + runs-on: [ubuntu-latest, macos-latest, windows-latest] |
| 18 | + |
| 19 | + defaults: |
| 20 | + run: |
| 21 | + shell: bash -l {0} |
| 22 | + |
| 23 | + name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }} |
| 24 | + runs-on: ${{ matrix.runs-on }} |
| 25 | + |
| 26 | + steps: |
| 27 | + |
| 28 | + - name: Basic GitHub action setup |
| 29 | + uses: actions/checkout@v2 |
| 30 | + |
| 31 | + - name: Set conda environment |
| 32 | + uses: mamba-org/provision-with-micromamba@main |
| 33 | + with: |
| 34 | + environment-name: myenv |
| 35 | + environment-file: environment-dev.yml |
| 36 | + cache-env: true |
| 37 | + |
| 38 | + - name: Configure using CMake |
| 39 | + run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DPYTHON_EXECUTABLE=`which python` -DDOWNLOAD_GTEST=ON |
| 40 | + |
| 41 | + - name: Install |
| 42 | + working-directory: build |
| 43 | + run: make install |
| 44 | + |
| 45 | + - name: Build xtensor-python |
| 46 | + working-directory: build |
| 47 | + run: make test_xtensor_python |
| 48 | + |
| 49 | + - name: Test xtensor-python |
| 50 | + working-directory: build/test |
| 51 | + run: ./test_xtensor_python |
| 52 | + |
| 53 | + - name: Test xtensor-python (Python) |
| 54 | + run: py.test -s |
| 55 | + |
| 56 | + - name: Example - readme 1 |
| 57 | + working-directory: docs/source/examples/readme_example_1 |
| 58 | + run: | |
| 59 | + cmake -Bbuild -DPython_EXECUTABLE=`which python` |
| 60 | + cd build |
| 61 | + cmake --build . |
| 62 | + cp ../example.py . |
| 63 | + python example.py |
| 64 | + cd .. |
| 65 | +
|
| 66 | + - name: Example - Copy 'cast' |
| 67 | + working-directory: docs/source/examples/copy_cast |
| 68 | + run: | |
| 69 | + cmake -Bbuild -DPython_EXECUTABLE=`which python` |
| 70 | + cd build |
| 71 | + cmake --build . |
| 72 | + cp ../example.py . |
| 73 | + python example.py |
| 74 | + cd .. |
| 75 | +
|
| 76 | + - name: Example - SFINAE |
| 77 | + working-directory: docs/source/examples/sfinae |
| 78 | + run: | |
| 79 | + cmake -Bbuild -DPython_EXECUTABLE=`which python` |
| 80 | + cd build |
| 81 | + cmake --build . |
| 82 | + cp ../example.py . |
| 83 | + python example.py |
| 84 | + cd .. |
| 85 | +
|
0 commit comments