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
-
33
34
steps :
34
35
- uses : actions/checkout@v2
35
36
36
- - name : Setup Python
37
- uses : actions/setup-python@v2.2.2
37
+ - name : Set up Python
38
+ uses : actions/setup-python@v2
38
39
with :
39
- python-version : 3.8
40
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
40
41
41
- - name : Install diagrams dependencies
42
+ - name : Install system dependencies
42
43
run : |
43
44
sudo apt-get update
44
- sudo apt-get install nodejs npm graphviz
45
+ sudo apt-get install -y texlive-latex-extra latexmk nodejs npm graphviz
45
46
npm install -g @mermaid-js/mermaid-cli
46
47
47
- - name : Build HTML Documentation
48
+ - name : Install Python dependencies
48
49
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
-
50
+ python -m pip install --upgrade pip tox
51
+
52
+ - name : Build HTML documentation
53
+ run : tox -e doc
54
+
64
55
- name : Build PDF Documentation
65
56
run : |
66
57
sudo apt update
67
58
sudo apt-get install -y texlive-latex-extra latexmk
68
59
make -C doc latexpdf
69
60
70
- - name : Upload HTML Documentation
61
+ - name : Upload HTML documentation
71
62
72
63
with :
73
64
name : HTML-Documentation
74
- path : doc/build/html
65
+ path : .tox/doc_out_html/
75
66
retention-days : 7
76
67
77
68
- name : Upload PDF Documentation
@@ -81,17 +72,27 @@ jobs:
81
72
path : doc/build/latex/*.pdf
82
73
retention-days : 7
83
74
84
- Release :
75
+ - name : Deploy to gh-pages
76
+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
77
+
78
+ with :
79
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80
+ BRANCH : gh-pages
81
+ FOLDER : .tox/doc_out_html/
82
+ CLEAN : true
83
+ SINGLE_COMMIT : true
84
+
85
+ release :
85
86
if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
86
- needs : docs_build
87
+ needs : [style, docs]
87
88
runs-on : ubuntu-latest
88
89
steps :
89
90
- uses : actions/checkout@v2
90
91
91
92
- name : Set up Python
92
93
uses : actions/setup-python@v1
93
94
with :
94
- python-version : 3.8
95
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
95
96
96
97
- uses : actions/download-artifact@v2
97
98
0 commit comments