|
10 | 10 | release: |
11 | 11 | types: |
12 | 12 | - published |
13 | | -jobs: |
14 | | - unix: |
15 | | - name: ${{ matrix.os }} - ${{ matrix.python-version }} |
16 | 13 |
|
| 14 | +defaults: |
| 15 | + run: |
| 16 | + shell: bash -l -eo pipefail {0} |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + name: Build ${{ matrix.os }} py${{ matrix.python-version }} |
17 | 21 | runs-on: ${{ matrix.os }} |
| 22 | + |
18 | 23 | strategy: |
19 | 24 | fail-fast: true |
20 | 25 | matrix: |
21 | | - os: ['ubuntu-latest', 'macos-latest' ] |
22 | | - python-version: ['3.7','3.8', '3.9'] |
| 26 | + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
| 27 | + python-version: ['3.7', '3.8', '3.9'] |
23 | 28 |
|
24 | 29 | 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 | | - |
39 | | - - name: Dependencies |
40 | | - shell: bash -l {0} |
41 | | - run: mamba install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} pybind11 pdal pytest meshio |
42 | | - |
43 | | - - name: Install |
44 | | - shell: bash -l {0} |
45 | | - run: | |
46 | | - python setup.py develop -- -G "Ninja" -DWITH_TESTS=ON |
47 | | - pdal --drivers |
| 30 | + - name: Check out python-pdal |
| 31 | + uses: actions/checkout@v2 |
48 | 32 |
|
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 | | - py.test -v test/ |
56 | | -
|
57 | | - windows: |
58 | | - name: ${{ matrix.os }} - ${{ matrix.python-version }} |
59 | | - |
60 | | - runs-on: ${{ matrix.os }} |
61 | | - strategy: |
62 | | - fail-fast: true |
63 | | - matrix: |
64 | | - os: ['windows-latest'] |
65 | | - python-version: ['3.7','3.8', '3.9'] |
| 33 | + - name: Check out python-pdal-plugins |
| 34 | + uses: actions/checkout@v2 |
| 35 | + with: |
| 36 | + repository: PDAL/python-plugins |
| 37 | + path: ./plugins |
66 | 38 |
|
67 | | - steps: |
68 | | - - uses: actions/checkout@v2 |
69 | | - - uses: conda-incubator/setup-miniconda@v2 |
| 39 | + - name: Setup micromamba |
| 40 | + uses: mamba-org/provision-with-micromamba@main |
70 | 41 | with: |
71 | | - channels: conda-forge |
72 | | - python-version: ${{ matrix.python-version }} |
| 42 | + environment-file: .github/environment.yml |
| 43 | + extra-specs: | |
| 44 | + python=${{ matrix.python-version }} |
73 | 45 |
|
74 | | - - name: Dependencies |
75 | | - shell: cmd /C CALL "{0}" |
76 | | - run: | |
77 | | - call conda activate test |
78 | | - conda install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} pybind11 pdal pytest meshio |
| 46 | + - name: Install python-pdal |
| 47 | + run: pip install -e . |
79 | 48 |
|
80 | | - - name: Install |
81 | | - shell: cmd /C CALL "{0}" |
82 | | - run: | |
83 | | - call conda activate test |
84 | | - python setup.py develop -- -G "Ninja" -DWITH_TESTS=ON |
85 | | - pdal --drivers |
| 49 | + - name: Install python-pdal-plugins |
| 50 | + working-directory: ./plugins |
| 51 | + run: pip install -e . |
86 | 52 |
|
87 | 53 | - name: Test |
88 | | - shell: cmd /C CALL "{0}" |
89 | 54 | 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 |
| 55 | + export PDAL_DRIVER_PATH=$(python -c "import os, skbuild; print(os.path.join('plugins', skbuild.constants.SKBUILD_DIR(), 'cmake-build'))") |
| 56 | + pdal --drivers |
95 | 57 | py.test -v test/ |
96 | 58 |
|
97 | | - dist: |
98 | | - name: Distribution |
99 | | - needs: [windows, unix] |
| 59 | + - name: Build wheel distribution |
| 60 | + run: python setup.py --skip-cmake bdist_wheel |
100 | 61 |
|
101 | | - runs-on: ${{ matrix.os }} |
102 | | - strategy: |
103 | | - fail-fast: true |
104 | | - matrix: |
105 | | - os: ['ubuntu-latest'] |
106 | | - python-version: ['3.8'] |
| 62 | + - name: Build source distribution |
| 63 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' |
| 64 | + run: python setup.py sdist |
107 | 65 |
|
108 | | - steps: |
109 | | - - uses: actions/checkout@v2 |
110 | | - - uses: conda-incubator/setup-miniconda@v2 |
| 66 | + - name: Upload distribution(s) |
| 67 | + uses: actions/upload-artifact@v2 |
111 | 68 | with: |
112 | | - channels: conda-forge |
113 | | - python-version: ${{ matrix.python-version }} |
114 | | - mamba-version: "*" |
| 69 | + name: ${{ matrix.os }}-py${{ matrix.python-version }} |
| 70 | + path: ./dist/* |
115 | 71 |
|
116 | | - - name: Dependencies |
117 | | - shell: bash -l {0} |
118 | | - run: mamba install --yes --quiet -c conda-forge scikit-build numpy python=${{ matrix.python-version }} pybind11 pdal |
| 72 | + publish: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: [build] |
| 75 | + |
| 76 | + steps: |
| 77 | + - name: Download distribution(s) |
| 78 | + uses: actions/download-artifact@v2 |
| 79 | + with: |
| 80 | + path: ./artifacts |
119 | 81 |
|
120 | | - - name: sdist |
121 | | - shell: bash -l {0} |
| 82 | + - name: Move artifacts to dist |
122 | 83 | run: | |
123 | | - python setup.py sdist |
124 | | - ls dist |
| 84 | + mkdir dist |
| 85 | + find ./artifacts -type f -exec mv {} ./dist \; |
| 86 | + tree ./dist |
125 | 87 |
|
126 | | - - uses: pypa/gh-action-pypi-publish@master |
127 | | - name: Publish package |
| 88 | + - name: Publish package |
| 89 | + uses: pypa/gh-action-pypi-publish@master |
128 | 90 | if: github.event_name == 'release' && github.event.action == 'published' |
129 | 91 | with: |
130 | 92 | user: __token__ |
|
0 commit comments