Skip to content

Allow multiple folders in class_package node registration key #138

Allow multiple folders in class_package node registration key

Allow multiple folders in class_package node registration key #138

Workflow file for this run

name: CI/CD
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- created
jobs:
tests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
python:
- 3.8
pypi_build:
- complete
- only_plotting
- only_postgres
- only_r
- basic
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: before_install
run: |
echo "PYPI_BUILD=${{ matrix.pypi_build }}" >> $GITHUB_ENV
echo "BOTO_CONFIG=/dev/null" >> $GITHUB_ENV
echo "BUILD_OS=${{ matrix.os }}" >> $GITHUB_ENV
pip install wheel
- name: install_linux
if: matrix.os == 'ubuntu-latest'
run: |
bash scripts/linux_install.sh
- name: install_mac
if : matrix.os == 'macos-latest'
run: |
export MACOSX_DEPLOYMENT_TARGET=10.9
bash scripts/mac_install.sh
- name: install R
if: matrix.pypi_build == 'complete' || matrix.pypi_build == 'only_r'
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.2.0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- name: python install
run: |
pip install .[test]
mkdir cache
if [ $PYPI_BUILD = 'complete' ]; then
echo "Installing postgres and plotting requirements"
if [ $BUILD_OS = 'macos-latest' ]; then
export LDFLAGS="-L/usr/local/opt/graphviz/lib"
export CPPFLAGS="-I/usr/local/opt/graphviz/include"
elif [ $BUILD_OS = 'ubuntu-latest' ]; then
export LDFLAGS="-L/usr/lib/aarch64-linux-gnu"
export CPPFLAGS="-I/usr/include"
fi
pip install .[plotting]
unset LDFLAGS
unset CPPFLAGS
pip install .[postgres]
pip install .[R]
elif [ $PYPI_BUILD = 'only_postgres' ]; then
echo "Installing postgres requirements"
pip install .[postgres]
elif [ $PYPI_BUILD = 'only_plotting' ]; then
echo "Installing plotting requirements"
if [ $BUILD_OS = 'macos-latest' ]; then
export LDFLAGS="-L/usr/local/opt/graphviz/lib"
export CPPFLAGS="-I/usr/local/opt/graphviz/include"
elif [ $BUILD_OS = 'ubuntu-latest' ]; then
export LDFLAGS="-L/usr/lib/aarch64-linux-gnu"
export CPPFLAGS="-I/usr/include"
fi
python -m pip install \
--global-option=build_ext \
--global-option="-I$(brew --prefix graphviz)/include/" \
--global-option="-L$(brew --prefix graphviz)/lib/" \
pygraphviz>=1.10
unset LDFLAGS
unset CPPFLAGS
elif [ $PYPI_BUILD = 'only_r' ]; then
echo "Installing R requirements"
pip install .[R]
fi
- name: tests
run: |
if [ $PYPI_BUILD = 'complete' ]; then
python -m pytest
elif [ $PYPI_BUILD = 'only_plotting' ]; then
python -m pytest -m "not postgres"
elif [ $PYPI_BUILD = 'only_postgres' ]; then
python -m pytest -m "not plotting"
elif [ $PYPI_BUILD = 'only_r' ]; then
# r skipif handled internally - only need to specify not postgres or plotting
python -m pytest -m "not postgres and not plotting"
else
python -m pytest -m "not optional"
fi
build-and-publish:
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.8
architecture: 'x64'
- name: Install pypa/build
run: |
python -m \
pip install \
build \
sphinx \
myst_parser \
sphinx-rtd-theme \
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: publish to pypi
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: build docs
run: bash scripts/generate_docs.sh || exit 1
- name: publish github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs