Skip to content

Commit 178a933

Browse files
committed
moving docs generation from travis-ci to github actions
1 parent 4ec8c47 commit 178a933

File tree

2 files changed

+59
-31
lines changed

2 files changed

+59
-31
lines changed

.github/workflows/main.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ master ]
10+
# pull_request:
11+
# branches: [ master ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
doc:
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
23+
# Steps represent a sequence of tasks that will be executed as part of the job
24+
steps:
25+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26+
- uses: actions/checkout@v2
27+
28+
- name: "Set up Python"
29+
uses: actions/setup-python@v1
30+
with:
31+
python-version: 3.10
32+
33+
- name: "Install Python dependencies"
34+
run: |
35+
pip3 install setuptools
36+
pip3 install numpy 'six>=1.13' 'argparse'
37+
# for docs only
38+
sudo apt-get install -y pandoc graphviz
39+
pip install sphinx sphinx-gallery pandoc nbsphinx
40+
# python setup.py install
41+
42+
- name: "Build Sphinx Doc"
43+
run: |
44+
export PYTHONPATH=$PWD/python
45+
cd doc
46+
python -m sphinx -b html source build/html
47+
touch build/html/.nojekyll
48+
cd ..
49+
50+
# 3. Déploiement sur les Github Pages
51+
52+
- name: "Deploy Github Pages"
53+
uses: JamesIves/[email protected]
54+
with:
55+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
BRANCH: gh-pages # <- Branche sur laquelle seront commités les fichiers
57+
FOLDER: doc/build/html/ # <- Dossier contenant notre documentation générée

.travis.yml

+2-31
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,11 @@ sudo: false
22

33
matrix:
44
include:
5-
- os: osx
6-
language: generic
7-
name: python 3.7
85
- os: linux
96
language: python
10-
name: python 2.7
7+
name: python 3.10
118
python:
12-
- 2.7
13-
- os: linux
14-
language: python
15-
name: python 3.5
16-
python:
17-
- 3.5
18-
- os: linux
19-
language: python
20-
name: python 3.7
21-
python:
22-
- 3.7
9+
- 3.10
2310

2411
before_install:
2512
- echo "TRAVIS_PYTHON_VERSION:" "$TRAVIS_PYTHON_VERSION"
@@ -32,18 +19,13 @@ before_install:
3219
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/[email protected]/bin:$PATH"; ln -s `which python3` bin/python; ln -s `which pip3` bin/pip; export PATH="$PWD/bin:$PATH"; fi
3320
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ln -s `which python3` bin/python; ln -s `which pip3` bin/pip; export PATH="$PWD/bin:$PATH"; fi
3421
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python --version; fi
35-
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "3.5" ]]; then sudo apt-get install -y pandoc graphviz; pip install sphinx sphinx-gallery pandoc nbsphinx "PyQt5<5.13"; fi
3622

3723
install:
3824
- pip install "six~=1.13" paramiko zmq
39-
- if [ ${TRAVIS_PYTHON_VERSION} == "2.7" ]; then pip install subprocess32; fi
4025
- pip install codecov
4126
- python setup.py install
4227
- export QT_API=pyqt5
4328
- if [[ $TRAVIS_OS_NAME == linux ]]; then pip install pre-commit; fi
44-
# build doc; set .nojekyll otherwise github.io doesn't copy dirs starting
45-
# with '_' (such as '_static')
46-
- if [[ "$TRAVIS_OS_NAME" = "linux" && "$TRAVIS_PYTHON_VERSION" == "3.5" ]]; then cd doc && make html && touch build/html/.nojekyll && cd ..; fi
4729
- if [[ -n "$GITHUB_ACCESS_TOKEN" ]]; then export PUSH_DOC_TO_GH_PAGES=yes; fi
4830
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cat /proc/cpuinfo && free; fi
4931

@@ -57,17 +39,6 @@ script:
5739
after_success:
5840
- codecov
5941

60-
deploy:
61-
provider: pages
62-
skip_cleanup: true
63-
github_token: $GITHUB_ACCESS_TOKEN
64-
target-branch: gh-pages
65-
local-dir: doc/build/html
66-
on:
67-
branch: master
68-
condition: $PUSH_DOC_TO_GH_PAGES == yes && $TRAVIS_OS_NAME == linux && $TRAVIS_PYTHON_VERSION == 3.5
69-
70-
7142
cache:
7243
directories:
7344
- $HOME/.cache/pre-commit

0 commit comments

Comments
 (0)