modernize with scikit-build-core #85
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- '*' | |
release: | |
types: | |
- published | |
defaults: | |
run: | |
shell: bash -l -eo pipefail {0} | |
jobs: | |
build: | |
name: Build ${{ matrix.os }} py${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Setup micromamba | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
auto-update-conda: true | |
environment-file: .github/environment.yml | |
- name: Install | |
shell: bash -l {0} | |
run: pip install . -Ccmake.define.WITH_TESTS=ON . | |
- name: Test | |
shell: bash -l {0} | |
env: | |
EXT: ${{ matrix.os == 'windows-latest' && '.exe' || '' }} | |
run: | | |
export PYTHONHOME=$CONDA_PREFIX | |
#export PDAL_DRIVER_PATH=$(python -c "import os, skbuild; print(os.path.join(skbuild.constants.SKBUILD_DIR(), 'cmake-build'))") | |
export PDAL_DRIVER_PATH=`pwd`:/build | |
echo PDAL_DRIVER_PATH | |
ls $PDAL_DRIVER_PATH | |
pdal --drivers | |
$PDAL_DRIVER_PATH/pdal_filters_python_test$EXT | |
$PDAL_DRIVER_PATH/pdal_io_numpy_test$EXT | |
dist: | |
name: Distribution | |
needs: [build] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ['ubuntu-latest'] | |
python-version: ['3.11'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup micromamba | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
auto-update-conda: true | |
mamba-version: "*" | |
- name: Dependencies | |
shell: bash -l {0} | |
run: mamba install --yes --quiet -c conda-forge build python=${{ matrix.python-version }} pdal | |
- name: sdist | |
shell: bash -l {0} | |
run: | | |
python -m build . --sdist | |
ls dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
name: Publish package | |
if: github.event_name == 'release' && github.event.action == 'published' | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} | |
packages_dir: ./dist |