Skip to content

Commit 012cd0b

Browse files
committed
CI revamp
- Merge jobs for Unix & Windows - Move conda dependencies to environment.yml - Replace miniconda with micromamba - Delete release job
1 parent c54644e commit 012cd0b

File tree

2 files changed

+32
-108
lines changed

2 files changed

+32
-108
lines changed

.github/environment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: test
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- scikit-build
6+
- numpy
7+
- pdal

.github/workflows/build.yml

Lines changed: 25 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -7,125 +7,42 @@ on:
77
push:
88
branches:
99
- '*'
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
3810

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}
5814

15+
jobs:
16+
build:
17+
name: Build ${{ matrix.os }} py${{ matrix.python-version }}
5918
runs-on: ${{ matrix.os }}
19+
6020
strategy:
6121
fail-fast: true
6222
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']
6525

6626
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
7229

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 }}
7836
7937
- 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 .
8639

8740
- 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' || '' }}
12143
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

Comments
 (0)