test and make pages #2136
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: test and make pages | |
on: | |
push: | |
branches: [ test ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: "0 2 * * *" | |
workflow_dispatch: | |
jobs: | |
test: | |
name: hazard test | |
runs-on: ubuntu-latest | |
env: | |
MPLBACKEND: 'Agg' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
git clone --depth=1 https://github.com/gem/oq-engine.git | |
cd oq-engine | |
python3 install.py devel | |
cd .. | |
source ~/openquake/bin/activate | |
pip list | |
pip install -e . | |
pip install pytest | |
- name: Run test with pytest | |
run: | | |
source ~/openquake/bin/activate | |
oq dbserver upgrade | |
oq --version | |
sleep 3 | |
cd openquake | |
export MPLBACKEND=Agg | |
pytest -vsx --color=yes cat ghm man mbt sub wkf smt | |
pages: | |
name: pages | |
runs-on: ubuntu-latest | |
env: | |
MPLBACKEND: 'Agg' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install OpenQuake dependencies | |
run: | | |
sudo apt-get install pandoc | |
python -m pip install --upgrade pip | |
git clone --depth=1 https://github.com/gem/oq-engine.git | |
cd oq-engine | |
python3 install.py devel | |
sleep 3 | |
source ~/openquake/bin/activate | |
pip install sphinx | |
pip install recommonmark | |
pip install sphinx_rtd_theme | |
pip install nbsphinx | |
- name: Make html pages | |
run: | | |
source ~/openquake/bin/activate | |
cd docsrc ; sphinx-apidoc -o contents/ ../openquake ; make html | |
touch _build/html/.nojekyll | |
- name: Deploy to GitHub Pages | |
if: success() | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
target_branch: gh-pages | |
build_dir: docsrc/_build/html/ | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |