test and make pages #386
This file contains hidden or 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: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: "0 1 * * *" | |
jobs: | |
test: | |
name: hazard test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install OQ and dependencies | |
run: | | |
sudo apt-get install libspatialindex-dev | |
git clone --depth=1 https://github.com/gem/oq-engine.git | |
cd oq-engine | |
python ./install.py devel | |
cd .. | |
source $HOME/openquake/bin/activate | |
pip install h3 | |
pip install -r requirements.txt | |
pip install -e . | |
deactivate | |
- name: Run test with pytest | |
run: | | |
source $HOME/openquake/bin/activate | |
pytest openquake tests -W ignore::UserWarning | |
pages: | |
name: pages | |
needs: test | |
runs-on: ubuntu-latest | |
env: | |
MPLBACKEND: 'Agg' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install sphinx | |
pip install recommonmark | |
- name: Make html pages | |
run: | | |
cd doc_src ; sphinx-apidoc -o source/ ../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: doc_src/build/html/ | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |