Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 20 additions & 52 deletions .github/workflows/CI_actions.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,45 @@
# 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 .

# CI Tests that runs unittests and doc build
# Triggered on pull requests and pushes to master

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]

# 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 }}
runs-on: "ubuntu-latest"
env:
PYTHON_VERSION: "3.10"
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, 3.12]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]

# 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
run: echo "date=$(date +'%Y-%m')" >> "$GITHUB_OUTPUT"

- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.PYTHON_VERSION }}

- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v5
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: |
sudo apt install pandoc
python -m pip install --upgrade pip
pip install setuptools
pip install -r requirements/requirements-docs.txt
pip install -r requirements/requirements.txt
pip install .
conda update conda
conda install -c conda-forge pandoc
pip install .["docs"]
# run notebooks
sed -i -E "s/nbsphinx_execute *=.*/nbsphinx_execute = 'always'/g" doc/conf.py
- name: make html
Expand All @@ -69,50 +48,39 @@ jobs:
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
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false

steps:

- name: Get current year-month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
run: echo "date=$(date +'%Y-%m')" >> "$GITHUB_OUTPUT"

- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v5
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 setuptools
pip install -r requirements/requirements-docs.txt
pip install -r requirements/requirements-tests.txt
pip install -r requirements/requirements.txt
pip install .
pip install .["tests"]

- name: run tests
run: |
python --version
pytest viziphant
pytest
1 change: 1 addition & 0 deletions requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
elephant[extras]