add ability to specify indirect AvgSA GMMs in SMT + auto plot of a flatfile against the GMPEs in either attenuation curves or spectra plots #4135
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: [ test ] | |
| pull_request: | |
| branches: [ master ] | |
| schedule: | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| git-ref: | |
| description: OQ engine branch | |
| default: master | |
| required: true | |
| jobs: | |
| test: | |
| name: hazard test | |
| runs-on: ubuntu-latest | |
| env: | |
| MPLBACKEND: 'Agg' | |
| GITHUB_PULL_REQUEST: ${{ github.event.number }} | |
| GITHUB_DEF_BR: ${{ github.event.repository.default_branch }} | |
| GITHUB_REF: ${{ github.ref }} | |
| GITHUB_HD_REF: ${{ github.head_ref }} | |
| GITHUB_BS_REF: ${{ github.base_ref }} | |
| GITHUB_INPUT_REF: ${{ github.event.inputs.git-ref }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt-get install -y gmt gmt-dcw gmt-gshhg libgmt-dev | |
| python -m pip install --upgrade pip | |
| git clone --depth=1 -b master https://github.com/gem/oq-engine.git | |
| cd oq-engine | |
| if [ -z "$GITHUB_INPUT_REF" ] | |
| then | |
| echo "This is not a workflow_dispatch RUN, use master for OQ engine" | |
| python install.py devel --version master | |
| else | |
| echo "This is a workflow_dispatch RUN, use: $GITHUB_INPUT_REF for OQ engine" | |
| python install.py devel --version ${GITHUB_INPUT_REF} | |
| fi | |
| source ~/openquake/bin/activate | |
| cd .. | |
| pip install -r requirements-py311-linux.txt | |
| pip install -e . | |
| pip install pytest | |
| - name: Run test with pytest | |
| run: | | |
| source ~/openquake/bin/activate | |
| oq engine --upgrade-db | |
| oq --version | |
| sleep 3 | |
| cd openquake | |
| pytest -vs --color=yes cat ghm man mbi mbt sub wkf smt fnm | |
| pages: | |
| name: pages | |
| runs-on: ubuntu-latest | |
| needs: test | |
| env: | |
| MPLBACKEND: 'Agg' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.11" | |
| - 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 }} |