8
8
branches :
9
9
- main
10
10
11
+ env :
12
+ MAIN_PYTHON_VERSION : ' 3.10'
13
+
11
14
jobs :
12
- pre-commit :
13
- name : Pre-commit checks
14
- runs-on : ubuntu-latest
15
15
16
+ style :
17
+ name : Code style
18
+ runs-on : ubuntu-latest
16
19
steps :
17
20
- uses : actions/checkout@v2
18
- - name : Setup Python
21
+ - name : Set up Python
19
22
uses : actions/setup-python@v2
20
23
with :
21
- python-version : ' 3.10 '
22
- - name : Install pre-commit requirements
24
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
25
+ - name : Install dependencies
23
26
run : |
24
- pip install pre-commit~=2.16.0
27
+ python -m pip install --upgrade pip tox
28
+ - name : Test with tox
29
+ run : tox -e style
25
30
26
- - name : Run pre-commit
27
- run : |
28
- pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
29
-
30
- docs_build :
31
+ docs :
32
+ name : Documentation
31
33
runs-on : ubuntu-latest
32
-
34
+ needs : docs-style
33
35
steps :
34
36
- uses : actions/checkout@v2
35
37
36
- - name : Setup Python
37
- uses : actions/setup-python@v2.2.2
38
+ - name : Set up Python
39
+ uses : actions/setup-python@v2
38
40
with :
39
- python-version : 3.8
41
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
40
42
41
- - name : Install diagrams dependencies
43
+ - name : Install system dependencies
42
44
run : |
43
45
sudo apt-get update
44
- sudo apt-get install nodejs npm graphviz
46
+ sudo apt-get install -y texlive-latex-extra latexmk nodejs npm graphviz
45
47
npm install -g @mermaid-js/mermaid-cli
46
48
47
- - name : Build HTML Documentation
49
+ - name : Install Python dependencies
48
50
run : |
49
- pip install -r requirements_docs.txt --disable-pip-version-check
50
- make -C doc html SPHINXOPTS="-W"
51
- touch doc/build/html/.nojekyll
52
- echo "dev.docs.pyansys.com" > doc/build/html/CNAME
53
-
54
- - name : Deploy to gh-pages on main
55
- if : github.ref == 'refs/heads/main'
56
-
57
- with :
58
- token : ${{ secrets.github_token }}
59
- branch : gh-pages
60
- folder : doc/build/html
61
- clean : true
62
- single-commit : true
63
-
51
+ python -m pip install --upgrade pip tox
52
+
53
+ - name : Build HTML documentation
54
+ run : tox -e doc
55
+
64
56
- name : Build PDF Documentation
65
57
run : |
66
58
sudo apt update
67
59
sudo apt-get install -y texlive-latex-extra latexmk
68
60
make -C doc latexpdf
69
61
70
- - name : Upload HTML Documentation
62
+ - name : Upload HTML documentation
71
63
72
64
with :
73
65
name : HTML-Documentation
74
- path : doc/build/html
66
+ path : .tox/doc_out_html/
75
67
retention-days : 7
76
68
77
69
- name : Upload PDF Documentation
@@ -81,17 +73,27 @@ jobs:
81
73
path : doc/build/latex/*.pdf
82
74
retention-days : 7
83
75
84
- Release :
76
+ - name : Deploy to gh-pages
77
+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
78
+
79
+ with :
80
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
81
+ BRANCH : gh-pages
82
+ FOLDER : .tox/doc_out_html/
83
+ CLEAN : true
84
+ SINGLE_COMMIT : true
85
+
86
+ release :
85
87
if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
86
- needs : docs_build
88
+ needs : [style, docs]
87
89
runs-on : ubuntu-latest
88
90
steps :
89
91
- uses : actions/checkout@v2
90
92
91
93
- name : Set up Python
92
94
uses : actions/setup-python@v1
93
95
with :
94
- python-version : 3.8
96
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
95
97
96
98
- uses : actions/download-artifact@v2
97
99
0 commit comments