Hypergraph refactor #249
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
# This workflow will setup GitHub-hosted runners and install the required dependencies for viziphant documentation. | |
# On pull requests and on pushes to master it will build the documentation . | |
name: tests | |
# define events that trigger workflow 'Viziphant-tests' | |
on: | |
# run on pull requests to master branch | |
pull_request: | |
branches: [master] | |
types: [synchronize, opened, reopened, ready_for_review] | |
# run on pushes to master branch | |
push: | |
#branches: [master] | |
# jobs define the steps that will be executed on the runner | |
jobs: | |
# install dependencies for the documentation and build .html | |
docs: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# OS [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest] | |
# relevant python versions for viziphant: [3.7, 3.8, 3.9, "3.10", 3.11] | |
python-version: [3.8, 3.9, "3.10", 3.11] | |
# do not cancel all in-progress jobs if any matrix job fails | |
fail-fast: false | |
steps: | |
- name: Get current year-month | |
id: date | |
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements files | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('**/requirements.txt') }}-${{ steps.date.outputs.date }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/requirements-docs.txt | |
pip install -r requirements/requirements.txt | |
pip install . | |
conda update conda | |
conda install -c conda-forge pandoc | |
# run notebooks | |
sed -i -E "s/nbsphinx_execute *=.*/nbsphinx_execute = 'always'/g" doc/conf.py | |
- name: make html | |
run: | | |
python --version | |
cd doc | |
make html | |
# install dependencies and run tests with pytest | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# OS [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest] | |
# relevant python versions for viziphant: [3.7, 3.8, 3.9, "3.10"] | |
python-version: [3.9] | |
# do not cancel all in-progress jobs if any matrix job fails | |
fail-fast: false | |
steps: | |
- name: Get current year-month | |
id: date | |
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements files | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('**/requirements.txt') }}-${{ steps.date.outputs.date }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/requirements-docs.txt | |
pip install -r requirements/requirements-tests.txt | |
pip install -r requirements/requirements.txt | |
pip install . | |
- name: run tests | |
run: | | |
python --version | |
pytest viziphant |