Clone the desired engine branch but get the install.py from master #4
Workflow file for this run
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: QGIS LTR unit and integration test vs Engine LTR and latest | |
on: | |
# FIXME: enable only scheduled or triggered manually | |
push: | |
branches: | |
- '**' | |
schedule: | |
- cron: "0 2 * * *" | |
jobs: | |
Tests_and_docs: | |
runs-on: ubuntu-latest | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# matrix: | |
# os: | |
# - ubuntu-latest | |
# - windows-latest | |
# - macos-latest | |
strategy: | |
matrix: | |
# FIXME: it would be better to point to lts and latest if possible | |
RELEASE_VERSION: [engine-3.16, engine-3.18] | |
# env: | |
# RELEASE_VERSION: engine-3.16 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 🐍 Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: ⏳ Clone engine and restore oqdata and docker container | |
run: | | |
set -x | |
IRMT_BR=${{ matrix.RELEASE_VERSION }} | |
ENGINE_BR=$IRMT_BR | |
if [ "$(git ls-remote --heads https://github.com/gem/oq-engine.git ${ENGINE_BR})" == "" ]; then | |
exit 1 | |
fi | |
# git clone -b $ENGINE_BR --depth=1 https://github.com/gem/oq-engine.git | |
git clone -b $ENGINE_BR --depth=1 https://github.com/gem/oq-engine.git | |
PY_VER=`echo py${{ matrix.python-version }} | tr -d .` | |
echo $PY_VER | |
cd oq-engine | |
git checkout master -- install.py | |
export PIP_DEFAULT_TIMEOUT=100 | |
python3 install.py devel --version $ENGINE_BR | |
cd .. | |
echo "Restore OQ-Engine demos for $ENGINE_BR branch " | |
source $HOME/openquake/bin/activate | |
oq reset -y | |
oq restore https://artifacts.openquake.org/travis/oqdata-${ENGINE_BR}.zip ~/oqdata | |
oq webui start 172.17.0.1:8800 --skip-browser &> webui.log & | |
git checkout $ENGINE_BR | |
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` | |
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 qgis/qgis:release-3_28 | |
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 | |
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 | |
IRMT_BR=${{ matrix.RELEASE_VERSION }} | |
ENGINE_BR=$IRMT_BR | |
if [ "$(git ls-remote --heads https://github.com/gem/oq-engine.git ${ENGINE_BR})" == "" ]; then | |
ENGINE_BR='master'; | |
fi | |
docker exec qgis sh -c "git clone -q -b $ENGINE_BR --depth=1 https://github.com/gem/oq-engine.git && echo 'Running against oq-engine/$GITHUB_BR'" | |
docker exec qgis sh -c "qgis_setup.sh svir" | |
docker exec -t qgis sh -c "cd /tests_directory && qgis_testrunner.sh svir.test.integration.test_drive_oq_engine" | |
- name: 📖 Make documentation | |
run: | | |
set -x | |
docker exec qgis sh -c "apt update --allow-releaseinfo-change; DEBIAN_FRONTEND=noninteractive apt install -y latexmk texlive-latex-extra python3-matplotlib python3-sphinx python3-sphinx-rtd-theme dvipng" | |
docker exec -t qgis sh -c "export PYTHONPATH=$PYTHONPATH:/tests_directory; cd /tests_directory/svir/help; make latexpdf; make html" | |
- name: ㏒ Display web logs | |
run: | | |
set -x | |
cat webui.log | |