Skip to content

Wait curl, then run qgis installer #2

Wait curl, then run qgis installer

Wait curl, then run qgis installer #2

Workflow file for this run

name: Test on Windows
on:
# NOTE: enables only scheduled or triggered manually, NOT on pull requests
workflow_dispatch:
inputs:
git-ref:
description: Git Ref
default: master
required: true
push:
branches:
- '**'
# schedule:
# - cron: "0 3 * * *"
jobs:
Tests_and_docs:
strategy:
fail-fast: false
matrix:
# NOTE: checking also master to make sure risk workshop demos keep working also on master
# TODO: it would be better to point to lts and latest if possible
# ENGINE_BR: ['engine-3.16', 'engine-3.18', 'master']
ENGINE_BR: [master']
# NOTE: keep it updated with QGIS ltr
# QGIS_DOCKER_VERSION: ['qgis/qgis:release-3_28', 'qgis/qgis:latest']
# QGIS_INSTALLER: ['QGIS-OSGeo4W-3.28.14-1.msi', 'QGIS-OSGeo4W-3.34.3-1.msi']
QGIS_INSTALLER: ['QGIS-OSGeo4W-3.28.14-1.msi']
# DEMOS: ['oqdata', 'risk-oqdata']
DEMOS: ['risk-oqdata']
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: 🐍 Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
ref: ${{ matrix.ENGINE_BR }}
- name: Install QGIS
run: |
curl https://qgis.org/downloads/${{ matrix.QGIS_INSTALLER }} && Start-Process -FilePath ".\{{ matrix.QGIS_INSTALLER }}" -ArgumentList "/quiet /passive" -Wait;
- name: ⏳ Clone engine and restore oqdata
run: |
set -x
echo "Running on ${{ matrix.os }}"
ENGINE_BR=${{ matrix.ENGINE_BR }}
IRMT_BR=$ENGINE_BR
git fetch
git checkout $IRMT_BR
curl -O https://raw.githubusercontent.com/gem/oq-engine/master/install.py
ls -lrt install.py
echo "Using branch ${ENGINE_BR}"
if [ "$(git ls-remote --heads https://github.com/gem/oq-engine.git ${ENGINE_BR})" = "" ]; then
echo "Branch ${ENGINE_BR} not found in gem/oq-engine repository"
exit 1
fi
# get release version from branch name (e.g. 'engine-3.16' -> '3.16')
prefix="engine-"
if [[ $ENGINE_BR == ${prefix}* ]]; then
RELEASE_VERSION="${ENGINE_BR#${prefix}}"
else
RELEASE_VERSION=$ENGINE_BR
fi
python3 install.py user --version=${RELEASE_VERSION}
export PIP_DEFAULT_TIMEOUT=100
echo "Restore ${{matrix.DEMOS}} demos for $ENGINE_BR branch "
source $HOME/openquake/bin/activate
oq reset -y
oq restore https://artifacts.openquake.org/travis/${{matrix.DEMOS}}-${ENGINE_BR}.zip ~/oqdata
oq webui start --skip-browser >> webui.log 2>&1 &
echo "Waiting WEBUI up on port 8800...."
while ! nc -z 172.17.0.1 8800; do
sleep 5
done
curl http://172.17.0.1:8800/v1/engine_version
#
# DOCKER_HOST=`ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+'`
# ENGINE_HOST=`echo http://$DOCKER_HOST:8800`
# # NOTE: release-3_28 needs to be kept updated to the current LTS
# docker run -d --name qgis -v /tmp/.X11-unix:/tmp/.X11-unix -v `pwd`:/tests_directory -e DISPLAY=:99 -e OQ_ENGINE_HOST='http://172.17.0.1:8800' \
# -e BRANCH="$IRMT_BR" -e ONLY_CALC_ID="$ONLY_CALC_ID" -e ONLY_OUTPUT_TYPE="$ONLY_OUTPUT_TYPE" -e GEM_QGIS_TEST=y ${{ matrix.QGIS_DOCKER_VERSION }}
# docker exec qgis bash -c "apt update --allow-releaseinfo-change; DEBIAN_FRONTEND=noninteractive apt install -y python3-scipy python3-matplotlib python3-pyqt5.qtwebkit"
# docker exec qgis bash -c "python3 -m pip install pytest"
# # OGR_SQLITE_JOURNAL=delete prevents QGIS from using WAL, which modifies geopackages even if they are just read
- name: ℧ Run unit test
run: |
set -x
ENGINE_BR=${{ matrix.ENGINE_BR }}
IRMT_BR=$ENGINE_BR
git fetch
git checkout $IRMT_BR
# docker exec -t qgis bash -c "export PYTHONPATH=/usr/share/qgis/python/plugins/:$PYTHONPATH; OGR_SQLITE_JOURNAL=delete pytest -v /tests_directory/svir/test/unit/"
- name: ⨕ Run Integration test
run: |
set -x
ENGINE_BR=${{ matrix.ENGINE_BR }}
IRMT_BR=$ENGINE_BR
git fetch
git checkout $IRMT_BR
# get release version from branch name (e.g. 'engine-3.16' -> '3.16')
prefix="engine-"
if [[ $ENGINE_BR == ${prefix}* ]]; then
RELEASE_VERSION="${ENGINE_BR#${prefix}}"
else
RELEASE_VERSION=$ENGINE_BR
fi
# NOTE: if we want to enable it, we need to use the proper folder after engine user installation
OQ_TEST_RUN_CALC=0
if [ "${{ matrix.DEMOS }}" != "risk-oqdata" -a "${RELEASE_VERSION}" != "3.16" ]; then
OQ_CHECK_MISSING_OUTPUTS=1
else
OQ_CHECK_MISSING_OUTPUTS=0
fi
echo "OQ_CHECK_MISSING_OUTPUTS: ${OQ_CHECK_MISSING_OUTPUTS}"
echo "OQ_TEST_RUN_CALC: ${OQ_TEST_RUN_CALC}"
# # NOTE: the check on the existence of the engine branch is already done in the previous step
# docker exec qgis sh -c "echo 'Running against oq-engine on branch ${ENGINE_BR}'"
# docker exec qgis sh -c "qgis_setup.sh svir"
# docker exec -e OQ_CHECK_MISSING_OUTPUTS=${OQ_CHECK_MISSING_OUTPUTS} -e OQ_TEST_RUN_CALC=${OQ_TEST_RUN_CALC} \
# -t qgis sh -c "env && cd /tests_directory && qgis_testrunner.sh svir.test.integration.test_drive_oq_engine"
- name: ㏒ Save webui log as artifact
uses: actions/upload-artifact@v2
if: always()
with:
name: WebUI-log
path: webui.log