|
7 | 7 | push: |
8 | 8 | branches: |
9 | 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', '3.9'] |
23 | | - |
24 | | - steps: |
25 | | - - uses: actions/checkout@v2 |
26 | | - - uses: conda-incubator/setup-miniconda@v2 |
27 | | - with: |
28 | | - python-version: ${{ matrix.python-version }} |
29 | | - mamba-version: "*" |
30 | | - activate-environment: test |
31 | | - channels: conda-forge |
32 | | - auto-activate-base: false |
33 | | - |
34 | | - - name: Linux dependencies |
35 | | - if: matrix.os == 'ubuntu-latest' |
36 | | - shell: bash -l {0} |
37 | | - run: sudo apt-get install gcc-multilib -y |
38 | 10 |
|
39 | | - - name: Dependencies |
40 | | - shell: bash -l {0} |
41 | | - run: mamba install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} pdal |
42 | | - |
43 | | - - name: Install |
44 | | - shell: bash -l {0} |
45 | | - run: | |
46 | | - SKBUILD_CONFIGURE_OPTIONS="-DWITH_TESTS=ON" pip install -e . |
47 | | - pdal --drivers |
48 | | -
|
49 | | - - name: Test |
50 | | - shell: bash -l {0} |
51 | | - run: | |
52 | | - export PDAL_DRIVER_PATH=$(python -c "import skbuild; print(skbuild.constants.SKBUILD_DIR())")/cmake-build |
53 | | - $PDAL_DRIVER_PATH/pdal_filters_python_test |
54 | | - $PDAL_DRIVER_PATH/pdal_io_numpy_test |
55 | | -
|
56 | | - windows: |
57 | | - name: ${{ matrix.os }} - ${{ matrix.python-version }} |
| 11 | +defaults: |
| 12 | + run: |
| 13 | + shell: bash -l -eo pipefail {0} |
58 | 14 |
|
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: Build ${{ matrix.os }} py${{ matrix.python-version }} |
59 | 18 | runs-on: ${{ matrix.os }} |
| 19 | + |
60 | 20 | strategy: |
61 | 21 | fail-fast: true |
62 | 22 | matrix: |
63 | | - os: ['windows-latest'] |
64 | | - python-version: ['3.7','3.8', '3.9'] |
| 23 | + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
| 24 | + python-version: ['3.7', '3.8', '3.9'] |
65 | 25 |
|
66 | 26 | steps: |
67 | | - - uses: actions/checkout@v2 |
68 | | - - uses: conda-incubator/setup-miniconda@v2 |
69 | | - with: |
70 | | - channels: conda-forge |
71 | | - python-version: ${{ matrix.python-version }} |
| 27 | + - name: Check out |
| 28 | + uses: actions/checkout@v2 |
72 | 29 |
|
73 | | - - name: Dependencies |
74 | | - shell: cmd /C CALL "{0}" |
75 | | - run: | |
76 | | - call conda activate test |
77 | | - conda install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} pdal |
| 30 | + - name: Setup micromamba |
| 31 | + uses: mamba-org/provision-with-micromamba@main |
| 32 | + with: |
| 33 | + environment-file: .github/environment.yml |
| 34 | + extra-specs: | |
| 35 | + python=${{ matrix.python-version }} |
78 | 36 |
|
79 | 37 | - name: Install |
80 | | - shell: cmd /C CALL "{0}" |
81 | | - run: | |
82 | | - call conda activate test |
83 | | - set "SKBUILD_CONFIGURE_OPTIONS=-DWITH_TESTS=ON" |
84 | | - pip install -e . |
85 | | - pdal --drivers |
| 38 | + run: SKBUILD_CONFIGURE_OPTIONS="-DWITH_TESTS=ON" pip install -e . |
86 | 39 |
|
87 | 40 | - name: Test |
88 | | - shell: cmd /C CALL "{0}" |
89 | | - run: | |
90 | | - call conda activate test |
91 | | - set PYTHONHOME=%CONDA_PREFIX% |
92 | | - for /f %%i in ('python -c "import skbuild; print(skbuild.constants.SKBUILD_DIR())"') do set PDAL_DRIVER_PATH=%%i\cmake-build |
93 | | - %PDAL_DRIVER_PATH%\pdal_filters_python_test.exe |
94 | | - %PDAL_DRIVER_PATH%\pdal_io_numpy_test.exe |
95 | | -
|
96 | | - dist: |
97 | | - name: Distribution |
98 | | - needs: [windows, unix] |
99 | | - |
100 | | - runs-on: ${{ matrix.os }} |
101 | | - strategy: |
102 | | - fail-fast: true |
103 | | - matrix: |
104 | | - os: ['ubuntu-latest'] |
105 | | - python-version: ['3.8'] |
106 | | - |
107 | | - steps: |
108 | | - - uses: actions/checkout@v2 |
109 | | - - uses: conda-incubator/setup-miniconda@v2 |
110 | | - with: |
111 | | - channels: conda-forge |
112 | | - python-version: ${{ matrix.python-version }} |
113 | | - mamba-version: "*" |
114 | | - |
115 | | - - name: Dependencies |
116 | | - shell: bash -l {0} |
117 | | - run: mamba install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} pdal |
118 | | - |
119 | | - - name: sdist |
120 | | - shell: bash -l {0} |
| 41 | + env: |
| 42 | + EXT: ${{ matrix.os == 'windows-latest' && '.exe' || '' }} |
121 | 43 | run: | |
122 | | - python setup.py sdist |
123 | | - ls dist |
124 | | -
|
125 | | - - uses: pypa/gh-action-pypi-publish@master |
126 | | - name: Publish package |
127 | | - if: github.event_name == 'release' && github.event.action == 'published' |
128 | | - with: |
129 | | - user: __token__ |
130 | | - password: ${{ secrets.pypi_token }} |
131 | | - packages_dir: ./dist |
| 44 | + export PYTHONHOME=$CONDA_PREFIX |
| 45 | + export PDAL_DRIVER_PATH=$(python -c "import os, skbuild; print(os.path.join(skbuild.constants.SKBUILD_DIR(), 'cmake-build'))") |
| 46 | + pdal --drivers |
| 47 | + $PDAL_DRIVER_PATH/pdal_filters_python_test$EXT |
| 48 | + $PDAL_DRIVER_PATH/pdal_io_numpy_test$EXT |
0 commit comments