Generalized geodesic distance and notable vertex prescription #262
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: Testing and release | |
on: | |
push: | |
branches: | |
- main | |
- development | |
tags: | |
# The regex: /^v?((\d+)(\.\d+)*)(-?(a|b|c|rc|alpha|beta)([0-9]+)?)?$ | |
- 'v[0-9].[0-9]+.[0-9]+*' | |
pull_request: | |
branches: | |
- main | |
- development | |
jobs: | |
build_linux: | |
name: Build-Test Linux | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/setup-python@v5 | |
id: pyexe | |
with: | |
python-version: '3.10' | |
# - name: Setup python libs | |
# id: pyexe | |
# run: | | |
# python3 --version | |
# python3 -m pip install pytest | |
# py_exe_path=$(which python3) | |
# echo ::set-output name=path::$py_exe_path | |
- name: Resolve dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libnetcdf-c++4-dev libnetcdf-dev xorg-dev libeigen3-dev pybind11-dev | |
- name: Build and test | |
run: | | |
mkdir -p build && cd build; | |
cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_PYMEM3DG=ON -DSUITESPARSE=OFF -DWITH_NETCDF=ON -DPython_EXECUTABLE:FILEPATH=${{ steps.pyexe.outputs.python-path }} --log-level=DEBUG .. | |
cmake --build . --config Release -j 4 | |
ctest -C Release -V -j 4 | |
build_macos: | |
name: Build-Test macOS | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-15] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: mem3dg | |
python-version: "3.11" | |
channels: conda-forge | |
- name: Resolve dependencies | |
run: | | |
conda install -c netcdf-cxx4 eigen pybind11 | |
- name: Build | |
run: | | |
mkdir -p build && cd build; | |
cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_PYMEM3DG=ON -DSUITESPARSE=OFF -DWITH_NETCDF=ON --log-level=DEBUG .. | |
cmake --build . --config Release -j 4 | |
- name: Test | |
run: ctest -C Release -V -j 4 | |
# build_windows: | |
# name: Build-Test Windows | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: [windows-latest] | |
# runs-on: ${{ matrix.os }} | |
# defaults: | |
# run: | |
# shell: bash | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# submodules: recursive | |
# - name: Setup python libs | |
# id: pyexe | |
# run: | | |
# python --version | |
# python -m pip install pytest | |
# py_exe_path=$(which python) | |
# echo ::set-output name=path::$py_exe_path | |
# - name: Restore from cache and install vcpkg | |
# # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op. | |
# uses: lukka/run-vcpkg@v11 | |
# with: | |
# vcpkgGitCommitId: 5c9f906558f9bb12ee9811d6edc98ec9255c6cda5 | |
# setupOnly: true | |
# - name: Download libraries | |
# run: $VCPKG_ROOT/vcpkg install netcdf-c:x64-windows netcdf-cxx4:x64-windows eigen3:x64-windows | |
# - name: Build and test | |
# run: | | |
# mkdir -p build && cd build; | |
# cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_PYMEM3DG=ON -DSUITESPARSE=OFF -DWITH_NETCDF=ON -DPython_EXECUTABLE:FILEPATH=${{ steps.pyexe.outputs.path }} -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" .. | |
# cmake --build . --config Release -j 4 | |
# ctest -C Release -V -j 4 | |
deploy_documentation: | |
name: Deploy documentation to Github pages | |
runs-on: ubuntu-latest | |
# needs: [build_windows, build_linux, build_macos] | |
# if: github.ref == 'refs/heads/master' | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Get Project Version | |
id: version | |
run: | | |
mem3dg_version=$(git describe --tags --always --dirty) | |
echo $mem3dg_version | |
echo ::set-output name=version::$mem3dg_version | |
- name: Configure python version | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Setup python libs | |
id: pyexe | |
run: | | |
python3 --version | |
py_exe_path=$(which python3) | |
echo ::set-output name=path::$py_exe_path | |
- name: Resolve dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libnetcdf-c++4-dev libnetcdf-dev xorg-dev libeigen3-dev pybind11-dev ninja-build doxygen | |
- name: Build pymem3dg and install | |
run: | | |
python3 -m pip install -v ".[docs]" | |
- name: Build docs | |
run: | | |
mkdir -p build && cd build; | |
cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_MEM3DG_DOCS=ON -DBUILD_PYMEM3DG=ON -DSUITESPARSE=OFF -DWITH_NETCDF=ON -DPython_EXECUTABLE:FILEPATH=${{ steps.pyexe.outputs.path }} .. | |
cmake --build . --target mem3dg_doxy_docs --config Release -j 4 | |
cmake --build . --target mem3dg_sphinx_docs --config Release -j 4 | |
- name: Deploy cpp docs | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
destination_dir: ${{ steps.version.outputs.version }}/cpp | |
publish_dir: ./build/docs/cpp/html | |
enable_jekyll: true | |
- name: Deploy python docs | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
destination_dir: ${{ steps.version.outputs.version }}/py | |
publish_dir: ./build/docs/py/html | |
enable_jekyll: true | |
deploy_to_pypi: | |
name: Deploy to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: [build_linux, build_macos] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Update python libs | |
run: python -m pip install build | |
- name: Configures source dist | |
run: python -m build --sdist | |
- name: Display structure of files | |
run: ls -R | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |