Skip to content

Commit fb1789c

Browse files
Break sphinx in workflow. Add PR CI (#92)
Co-authored-by: Mark Yeatman <129521731+myeatman-bdai@users.noreply.github.com>
1 parent cc809c1 commit fb1789c

File tree

2 files changed

+49
-38
lines changed

2 files changed

+49
-38
lines changed

.github/workflows/master.yml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ name: build
77
on:
88
push:
99
branches: [ master, future ]
10-
# pull_request:
11-
# branches: [ master ]
10+
pull_request:
11+
1212

1313
jobs:
1414
# Run tests on different versions of python
@@ -66,39 +66,5 @@ jobs:
6666
needs: unittest
6767
runs-on: ubuntu-latest
6868
steps:
69-
- uses: actions/checkout@v2
70-
- name: Set up Python 3.7
71-
uses: actions/setup-python@v1
72-
with:
73-
python-version: 3.7
74-
- name: Install dependencies
75-
run: |
76-
python -m pip install --upgrade pip
77-
pip install .[dev,docs]
78-
pip install git+https://github.com/petercorke/sphinx-autorun.git
79-
pip install sympy
80-
sudo apt-get install graphviz
81-
- name: Build docs
82-
run: |
83-
cd docs
84-
make html
85-
# Tell GitHub not to use jekyll to compile the docs
86-
touch build/html/.nojekyll
87-
cd ../
88-
- name: Commit documentation changes
89-
run: |
90-
git clone https://github.com/petercorke/spatialmath-python.git --branch gh-pages --single-branch gh-pages
91-
cp -r docs/build/html/* gh-pages/
92-
cd gh-pages
93-
git config --local user.email "action@github.com"
94-
git config --local user.name "GitHub Action"
95-
git add .
96-
git commit -m "Update documentation" -a || true
97-
# The above command will fail if no changes were present, so we ignore
98-
# that.
99-
- name: Push changes
100-
uses: ad-m/github-push-action@master
101-
with:
102-
branch: gh-pages
103-
directory: gh-pages
104-
github_token: ${{ secrets.GITHUB_TOKEN }}
69+
uses: ./.github/workflows/sphinx.yml
70+
if: ${{ github.event_name != 'pull_request' }}

.github/workflows/sphinx.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Sphinx
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
sphinx:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python 3.7
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.7
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install .[dev,docs]
19+
pip install git+https://github.com/petercorke/sphinx-autorun.git
20+
pip install sympy
21+
sudo apt-get install graphviz
22+
- name: Build docs
23+
run: |
24+
cd docs
25+
make html
26+
# Tell GitHub not to use jekyll to compile the docs
27+
touch build/html/.nojekyll
28+
cd ../
29+
- name: Commit documentation changes
30+
run: |
31+
git clone https://github.com/petercorke/spatialmath-python.git --branch gh-pages --single-branch gh-pages
32+
cp -r docs/build/html/* gh-pages/
33+
cd gh-pages
34+
git config --local user.email "action@github.com"
35+
git config --local user.name "GitHub Action"
36+
git add .
37+
git commit -m "Update documentation" -a || true
38+
# The above command will fail if no changes were present, so we ignore
39+
# that.
40+
- name: Push changes
41+
uses: ad-m/github-push-action@master
42+
with:
43+
branch: gh-pages
44+
directory: gh-pages
45+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)