Upgrade procedure for engine from 3.16 to Latest Release #710
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: Upgrade procedure for engine from 3.16 to Latest Release | |
on: | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Git Ref | |
default: master | |
required: true | |
schedule: | |
- cron: "33 12 * * *" | |
push: | |
branches: [ ae-upgrade ] | |
jobs: | |
install_and_upgrade: | |
runs-on: ${{ matrix.os }} | |
env: | |
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 }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
#os: [macos-latest, windows-latest, ubuntu-latest] | |
python-version: [3.8] | |
# | |
steps: | |
# This Checkout use git-ref keyword from dispatch | |
- name: Clone Repository (Master) | |
uses: actions/checkout@v3 | |
if: github.event.inputs.git-ref == '' | |
- name: Clone Repository (Custom Ref) | |
uses: actions/checkout@v3 | |
if: github.event.inputs.git-ref != '' | |
with: | |
ref: ${{ github.event.inputs.git-ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# You can test your matrix by printing the current Python version | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
# Use script to install engine and not the pip install . | |
- name: Install engine with install script and version 3.11 | |
run: | | |
sudo env "PATH=$PATH" python -m pip install --default-timeout=100 pip wheel setuptools --upgrade | |
sleep 2 | |
sudo env "PATH=$PATH" python install.py server | |
shell: bash | |
- name: Run demos to test installation | |
run: | | |
echo "$RUNNER_OS" | |
source /opt/openquake/venv/bin/activate | |
oq --version | |
oq engine --run "https://github.com/gem/oq-engine/blob/master/openquake/server/tests/data/classical.zip?raw=true" | |
shell: bash | |
- name: Upgrade engine to the current master | |
run: | | |
pwd | |
source /opt/openquake/venv/bin/activate | |
oq --version | |
deactivate | |
sudo env "PATH=$PATH" python install.py server --remove | |
sleep 10 | |
sudo env "PATH=$PATH" python install.py server --version=master | |
source /opt/openquake/venv/bin/activate | |
journalctl -xe -u openquake-dbserver | |
sleep 5 | |
oq --version | |
oq engine --run "https://github.com/gem/oq-engine/blob/master/openquake/server/tests/data/classical.zip?raw=true" | |
shell: bash |