Merge pull request #348 from xpsi-group/347-python-3-version-needs-fr… #166
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docs | |
on: | |
push: | |
branches: | |
- main | |
release: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
steps: | |
- name: Set up GCC | |
run: | | |
sudo apt-get install -y gcc | |
shell: bash -l {0} | |
- name: install gsl | |
run: | | |
sudo apt-get install -y libgsl-dev | |
- name: check out X-PSI v1.2.1 | |
uses: actions/checkout@v3 | |
with: | |
ref: python2 | |
- name: Install Python2 Conda environment with Micromamba | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
cache-env: true | |
cache-env-key: env-envkey-${{ github.sha }}-${{ github.run_attempt }} | |
environment-file: basic_environment.yml | |
environment-name: xpsipy2 | |
extra-specs: | | |
python=2.7 | |
- name : install docs dependencies | |
run: | | |
micromamba install sphinx=1.8.5 decorator=4.4.1 h5py | |
micromamba install -c conda-forge nbsphinx=0.5.1 nbconvert=5.6.1 | |
pip install sphinxcontrib-websupport==1.1.2 sphinx_rtd_theme==0.4.3 | |
- name: install X-PSI package | |
run: | | |
python setup.py install | |
shell: bash -l {0} | |
env: | |
CC: gcc-10 | |
- name : build docs | |
run: make html | |
working-directory: docs/ | |
- name : move docs | |
run : | | |
mkdir ../../../../py2 | |
mv build/html/* ../../../../py2/ | |
working-directory: docs/ | |
- name: check out X-PSI main | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Install Python3 Conda environment with Micromamba | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
cache-env: true | |
cache-env-key: env-envkey-${{ github.sha }}-${{ github.run_attempt }} | |
environment-file: basic_environment.yml | |
environment-name: xpsipy3 | |
extra-specs: | | |
python=3.10 | |
- name : install docs dependencies | |
run: | | |
micromamba install sphinx decorator h5py | |
micromamba install -c conda-forge nbsphinx nbconvert | |
pip install sphinxcontrib-websupport sphinx_rtd_theme | |
- name : install other needed packages | |
run: | | |
micromamba install -c conda-forge getdist nestcheck | |
- name: install X-PSI package | |
run: | | |
python setup.py install | |
shell: bash -l {0} | |
env: | |
CC: gcc-10 | |
- name : build docs | |
run: | | |
make html | |
mkdir build/html/py2 | |
mv ../../../../py2/* build/html/py2/ | |
working-directory: docs/ | |
- name: Deploy to GitHub Pages | |
if: success() | |
uses: crazy-max/ghaction-github-pages@v3 | |
with: | |
target_branch: gh-pages | |
build_dir: docs/build/html | |
jekyll: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |