|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - '*' |
| 10 | + release: |
| 11 | + types: |
| 12 | + - published |
| 13 | +jobs: |
| 14 | + unix: |
| 15 | + name: ${{ matrix.os }} - ${{ matrix.python-version }} |
| 16 | + |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + fail-fast: true |
| 20 | + matrix: |
| 21 | + os: ['ubuntu-latest', 'macos-latest' ] |
| 22 | + python-version: ['3.7','3.8'] |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v2 |
| 26 | + - uses: goanpeca/setup-miniconda@v1 |
| 27 | + with: |
| 28 | + auto-update-conda: true |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + activate-environment: test |
| 31 | + channels: conda-forge |
| 32 | + auto-activate-base: false |
| 33 | + |
| 34 | + - name: Dependencies |
| 35 | + shell: bash -l {0} |
| 36 | + run: | |
| 37 | + conda install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} compilers ninja pdal pytest conda-build -y |
| 38 | +
|
| 39 | + - name: Install |
| 40 | + shell: bash -l {0} |
| 41 | + run: | |
| 42 | + pip install . |
| 43 | + pdal --drivers |
| 44 | +
|
| 45 | + - name: Test |
| 46 | + shell: bash -l {0} |
| 47 | + run: | |
| 48 | + pip install -e . |
| 49 | + SKPATH=$(python -c "import skbuild; print (skbuild.constants.SKBUILD_DIR())")/cmake-build |
| 50 | + export PDAL_DRIVER_PATH=$SKPATH |
| 51 | + $SKPATH/pdal_filters_python_test |
| 52 | + $SKPATH/pdal_io_numpy_test |
| 53 | + py.test |
| 54 | +
|
| 55 | +
|
| 56 | + windows: |
| 57 | + name: ${{ matrix.os }} - ${{ matrix.python-version }} |
| 58 | + |
| 59 | + runs-on: ${{ matrix.os }} |
| 60 | + strategy: |
| 61 | + fail-fast: true |
| 62 | + matrix: |
| 63 | + os: ['windows-latest'] |
| 64 | + python-version: ['3.7','3.8'] |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v2 |
| 68 | + - uses: goanpeca/[email protected] |
| 69 | + with: |
| 70 | + channels: conda-forge |
| 71 | + auto-update-conda: true |
| 72 | + python-version: ${{ matrix.python-version }} |
| 73 | + |
| 74 | + |
| 75 | + - name: Dependencies |
| 76 | + shell: cmd /C CALL "{0}" |
| 77 | + run: | |
| 78 | +
|
| 79 | + call conda activate test |
| 80 | + conda install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} compilers cython ninja pdal pytest conda-build -y |
| 81 | +
|
| 82 | + - name: Install |
| 83 | + shell: cmd /C CALL "{0}" |
| 84 | + run: | |
| 85 | +
|
| 86 | + call conda activate test |
| 87 | + where python |
| 88 | + python setup.py develop -- -G "Ninja" |
| 89 | +
|
| 90 | + - name: Test |
| 91 | + shell: cmd /C CALL "{0}" |
| 92 | + run: | |
| 93 | + call conda activate test |
| 94 | + set PYTHONHOME=%CONDA_PREFIX% |
| 95 | + py.test |
| 96 | + for /f %%i in ('python -c "import skbuild; print (skbuild.constants.SKBUILD_DIR())"') do set SKPATH=%%i |
| 97 | + set PDAL_DRIVER_PATH=%SKPATH%\cmake-build |
| 98 | + %SKPATH%\cmake-build\pdal_filters_python_test.exe |
| 99 | + %SKPATH%\cmake-build\pdal_io_numpy_test.exe |
| 100 | + pdal --version |
| 101 | + pdal --drivers |
| 102 | +
|
| 103 | + dist: |
| 104 | + name: Distribution |
| 105 | + needs: [windows, unix] |
| 106 | + |
| 107 | + runs-on: ${{ matrix.os }} |
| 108 | + strategy: |
| 109 | + fail-fast: true |
| 110 | + matrix: |
| 111 | + os: ['ubuntu-latest'] |
| 112 | + python-version: ['3.8'] |
| 113 | + |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v2 |
| 116 | + - uses: goanpeca/[email protected] |
| 117 | + with: |
| 118 | + channels: conda-forge |
| 119 | + auto-update-conda: true |
| 120 | + python-version: ${{ matrix.python-version }} |
| 121 | + |
| 122 | + - name: Dependencies |
| 123 | + shell: bash -l {0} |
| 124 | + run: | |
| 125 | + conda install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} compilers cython ninja pdal pytest conda-build -y |
| 126 | +
|
| 127 | + - name: sdist |
| 128 | + shell: bash -l {0} |
| 129 | + run: | |
| 130 | + python setup.py sdist |
| 131 | + ls dist |
| 132 | +
|
| 133 | + - uses: pypa/gh-action-pypi-publish@master |
| 134 | + name: Publish package |
| 135 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 136 | + with: |
| 137 | + user: __token__ |
| 138 | + password: ${{ secrets.pypi_token }} |
| 139 | + packages_dir: ./dist |
0 commit comments