Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete the action used to run demos of selected engine versions and upload corresponding artifacts #9521

Merged
merged 6 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions .github/workflows/demos_ltr_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ on:
inputs:
git-ref:
description: Git Ref
default: engine-3.16 # FIXME: point to ltr
default: engine-3.16 # TODO: point to ltr
required: true
push:
# FIXME: it would be better to point to ltr and latest
# branches: [ demos_ltr_latest, engine-3.16, engine-3.17, engine-3.18 ]
branches: [ demos_ltr_latest ]
# TODO: it would be better to point to ltr and latest
branches: [ engine-3.16, engine-3.17, engine-3.18, engine-3.19]
jobs:
demos:
runs-on: ubuntu-latest
Expand All @@ -30,7 +29,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Set up Python 3.10
- name: Set up Python 3.10 # for compatibility with engine 3.16
uses: actions/setup-python@v5
with:
python-version: "3.10"
Expand All @@ -40,21 +39,18 @@ jobs:
pip install --default-timeout=100 -U pip
pip install pydata-sphinx-theme
- name: Install OpenQuake engine
# env:
# GITHUB_DEF_BR: ${{ github.event.repository.default_branch }}
# GITHUB_REF: ${{ github.ref }}
run: |
if [ -z "$GITHUB_INPUT_REF" ]
if ${{ github.event_name == 'pull_request' }}
then
echo " Is not a workflow_dispatch RUN, use: $GITHUB_DEF_BR "
python install.py devel --version ${GITHUB_DEF_BR}
echo "It is a pull request; use the corresponding branch: ${GITHUB_HD_REF}"
python install.py devel --version ${GITHUB_HD_REF}
else
echo " Is a workflow_dispatch RUN, use: $GITHUB_INPUT_REF "
GITHUB_BR=`echo ${{ github.head_ref }}`
echo "It was triggered manually; use the selected Git Ref: $GITHUB_INPUT_REF "
python install.py devel --version ${GITHUB_INPUT_REF}
fi
- name: Run demos and upload to ci.openquake.org if not workflow_dispatch
if: github.event.inputs.git-ref == ''
- name: Run demos and upload to ci.openquake.org
# uncomment the line below to avoid running this part when triggering the action manually
# if: github.event.inputs.git-ref == ''
shell: bash
env:
DOCS_SSH: ${{ secrets.DOCS_ARTIFACTS }}
Expand All @@ -70,14 +66,13 @@ jobs:
oq dump /tmp/oqdata.zip
oq restore /tmp/oqdata.zip /tmp/oqdata
helpers/zipdemos.sh $(pwd)/demos
echo " Check if this is a pull request or not"
if [ -z "$GITHUB_HD_REF" ]
if ${{ github.event_name == 'pull_request' }}
then
echo " Is not a pull request, use branch: $GITHUB_DEF_BR"
GITHUB_BR=`echo ${{ github.event.repository.default_branch }}`
echo "It is a pull request; use the corresponding branch: ${GITHUB_HD_REF}"
GITHUB_BR=${GITHUB_HD_REF}
else
echo " Is a pull request, use branch: $GITHUB_HD_BR"
GITHUB_BR=`echo ${{ github.head_ref }}`
echo "It was triggered manually; use the selected Git Ref: $GITHUB_INPUT_REF "
GITHUB_BR=${GITHUB_INPUT_REF}
fi
echo "BRANCH set to $GITHUB_BR"
gpg --quiet --batch --yes --decrypt --passphrase="$DOCS_SSH" --output ./.deploy_rsa ./.deploy_docs.enc
Expand Down
Loading