Add WQP #10
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: test docker deployment ⚙️ | |
on: [ push, pull_request ] | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: setup Python | |
with: | |
python-version: 3.8 | |
- name: install requirements 📦 | |
run: | | |
pip3 install -r requirements-dev.txt | |
python3 setup.py install | |
- name: software running on 📦 | |
run: | | |
docker version | |
docker-compose version | |
python3 -V | |
- name: run unit tests ⚙️ | |
run: | | |
pytest tests/unit | |
- name: setup wis2box configuration | |
run: | | |
cp tests/test.env dev.env | |
cat dev.env | |
python3 wis2box-ctl.py config | |
- name: build wis2box | |
run: | | |
python3 wis2box-ctl.py build | |
python3 wis2box-ctl.py update | |
- name: start containers ⚙️ | |
run: | | |
python3 wis2box-ctl.py start | |
python3 wis2box-ctl.py status -a | |
docker logs wis2box | |
- name: setup wis2box ⚙️ | |
run: | | |
sleep 10 | |
python3 wis2box-ctl.py execute wis2box environment show | |
- name: add Malawi data 🇲🇼 | |
env: | |
TOPIC_HIERARCHY: mwi.mwi_met_centre.data.core.weather.surface-based-observations.synop | |
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/mwi-surface-weather-observations.yml | |
TEST_DATA: /data/wis2box/observations/malawi | |
run: | | |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA | |
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA | |
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA | |
- name: add Italy data 🇮🇹 | |
env: | |
TOPIC_HIERARCHY: ita.roma_met_centre.data.core.weather.surface-based-observations.synop | |
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/ita-surface-weather-observations.yml | |
TEST_DATA: /data/wis2box/observations/italy | |
run: | | |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA | |
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA | |
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA | |
- name: add Algeria data 🇩🇿 | |
env: | |
TOPIC_HIERARCHY: dza.alger_met_centre.data.core.weather.surface-based-observations.synop | |
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/dza-surface-weather-observations.yml | |
TEST_DATA: /data/wis2box/observations/algeria | |
run: | | |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA | |
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA | |
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA | |
- name: sync stations 🔄 | |
run: | | |
sleep 15 | |
python3 wis2box-ctl.py execute wis2box metadata station publish-collection | |
- name: run integration tests ⚙️ | |
run: | | |
sleep 10 | |
pytest -s tests/integration | |
- name: run flake8 ⚙️ | |
run: | | |
find . -type f -name "*.py" | xargs flake8 | |
- name: build docs ⚙️ | |
uses: ammaraskar/sphinx-action@master | |
with: | |
pre-build-command: "apt-get install -y pandoc && cp requirements-dev.txt docs/requirements.txt" | |
docs-folder: "docs/" | |
- name: failed tests 🚩 | |
if: ${{ failure() }} | |
run: | | |
docker-compose --file docker/docker-compose.yml --file docker/docker-compose.override.yml --file docker/docker-compose.monitoring.yml --env-file dev.env --project-name wis2box_project ps | |
docker-compose --file docker/docker-compose.yml --file docker/docker-compose.override.yml --file docker/docker-compose.monitoring.yml --env-file dev.env --project-name wis2box_project logs |