-
Notifications
You must be signed in to change notification settings - Fork 7
116 lines (92 loc) · 3.68 KB
/
CI_actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# 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