Skip to content

Commit 4d24659

Browse files
committed
Update CI/CD to new tox workflow
1 parent 184b177 commit 4d24659

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

.github/workflows/ci-build.yml

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,70 +8,61 @@ on:
88
branches:
99
- main
1010

11+
env:
12+
MAIN_PYTHON_VERSION: '3.10'
13+
1114
jobs:
12-
pre-commit:
13-
name: Pre-commit checks
14-
runs-on: ubuntu-latest
1515

16+
style:
17+
name: Code style
18+
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v2
18-
- name: Setup Python
21+
- name: Set up Python
1922
uses: actions/setup-python@v2
2023
with:
21-
python-version: '3.10'
22-
- name: Install pre-commit requirements
24+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
25+
- name: Install dependencies
2326
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
2530

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
3133
runs-on: ubuntu-latest
32-
3334
steps:
3435
- uses: actions/checkout@v2
3536

36-
- name: Setup Python
37-
uses: actions/setup-python@v2.2.2
37+
- name: Set up Python
38+
uses: actions/setup-python@v2
3839
with:
39-
python-version: 3.8
40+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
4041

41-
- name: Install diagrams dependencies
42+
- name: Install system dependencies
4243
run: |
4344
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
4546
npm install -g @mermaid-js/mermaid-cli
4647
47-
- name: Build HTML Documentation
48+
- name: Install Python dependencies
4849
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-
uses: JamesIves/[email protected]
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+
6455
- name: Build PDF Documentation
6556
run: |
6657
sudo apt update
6758
sudo apt-get install -y texlive-latex-extra latexmk
6859
make -C doc latexpdf
6960
70-
- name: Upload HTML Documentation
61+
- name: Upload HTML documentation
7162
uses: actions/[email protected]
7263
with:
7364
name: HTML-Documentation
74-
path: doc/build/html
65+
path: .tox/doc_out_html/
7566
retention-days: 7
7667

7768
- name: Upload PDF Documentation
@@ -81,17 +72,27 @@ jobs:
8172
path: doc/build/latex/*.pdf
8273
retention-days: 7
8374

84-
Release:
75+
- name: Deploy to gh-pages
76+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
77+
uses: JamesIves/[email protected]
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:
8586
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
86-
needs: docs_build
87+
needs: [style, docs]
8788
runs-on: ubuntu-latest
8889
steps:
8990
- uses: actions/checkout@v2
9091

9192
- name: Set up Python
9293
uses: actions/setup-python@v1
9394
with:
94-
python-version: 3.8
95+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
9596

9697
- uses: actions/download-artifact@v2
9798

0 commit comments

Comments
 (0)