Using pybind11_mkdoc
#126
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: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
standard: | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- runs-on: ubuntu-latest | |
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1 | |
- runs-on: macos-latest | |
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=1 | |
- runs-on: windows-latest | |
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=1 -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ | |
defaults: | |
run: | |
shell: bash -e -l {0} | |
name: ${{ matrix.runs-on }} | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Clone this library | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create conda environment | |
uses: mamba-org/setup-micromamba@main | |
with: | |
environment-file: environment.yaml | |
environment-name: myenv | |
init-shell: bash | |
cache-downloads: true | |
create-args: >- | |
${{ runner.os == 'Windows' && 'clang_win-64' || '' }} | |
- name: Export version of this library | |
run: | | |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV | |
- name: Clone pybind11_mkdoc | |
uses: actions/checkout@v3 | |
with: | |
path: pybind11_mkdoc | |
repository: pybind/pybind11_mkdoc | |
fetch-depth: 0 | |
- name: Install pybind11_mkdoc | |
working-directory: pybind11_mkdoc | |
run: python -m pip install . -v | |
- name: Build and install Python module | |
run: python -m pip install . -v --no-build-isolation | |
- name: Run Python tests | |
run: pytest | |
- name: Run Python examples | |
if: runner.os == 'linux' | |
working-directory: docs/examples | |
run: | | |
python S2.py --check | |
python S2_autocorrelation.py --check | |
python S2_mask.py --check | |
python S2_ensemble.py --check | |
python C2.py --check | |
python L.py --check | |
python W2.py --check | |
python W2c.py --check | |
python clusters.py --check | |
python clusters_centers.py --check | |
python clusters_dilate.py --check | |
python clusters_dilate_periodic.py --check | |
python heightheight.py --check | |
python mean.py --check | |
python pixel_path.py --check | |
python structure.py --check | |
- name: Configure using CMake | |
run: cmake -Bbuild ${{ matrix.config }} | |
- name: Build C++ | |
working-directory: build | |
run: cmake --build . | |
- name: Run C++ tests | |
working-directory: build | |
run: ctest --output-on-failure | |
- name: Build doxygen-docs (error on warning) | |
if: runner.os == 'linux' | |
working-directory: build | |
run: make html |