Dependency update checker #14
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: Dependency update checker | |
on: | |
schedule: | |
- cron: '0 12 * * 1' | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 # Don't run forever when stale | |
env: | |
# https://python-poetry.org/docs/configuration/#available-settings | |
POETRY_VIRTUALENVS_IN_PROJECT: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
- name: Install OS packages | |
run: | | |
sudo apt install -y gettext libgettextpo-dev libmariadb-dev-compat libmariadb-dev | |
pip install --upgrade pip poetry | |
- name: Cached dependencies & virtualenv | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cache/pypoetry/ | |
/home/runner/work/dsmr-reader/dsmr-reader/.venv | |
key: dependencies-update-check-${{ hashFiles('poetry.lock') }} | |
- name: Check & install Poetry dependencies | |
run: | | |
poetry check | |
poetry install | |
- name: Check for Poetry dependency updates | |
run: | | |
poetry update --dry-run --no-ansi | grep "Package operations: 0 installs, 0 updates, 0 removals" && exit 0 | |
poetry update --dry-run | grep -v "Skipped" | |
exit 1 | |
# @deprecated PIP (requirements.txt) check - Ensures it's in sync with Poetry - Required until DSMR-reader v5.x | |
- name: (@deprecated) Install Pip dependencies | |
run: | | |
poetry run pip install -r $GITHUB_WORKSPACE/dsmrreader/provisioning/requirements/base.txt | |
poetry run pip install -r $GITHUB_WORKSPACE/dsmrreader/provisioning/requirements/dev.txt | |
- name: (@deprecated) Check for Pip dependency updates, using Poetry venv | |
# The pip and packaging updates are to prevent false positives | |
run: | | |
poetry run pip install --upgrade pip packaging | |
poetry update --dry-run --no-ansi | grep "Package operations: 0 installs, 0 updates, 0 removals" && exit 0 | |
poetry update --dry-run | grep -v "Skipped" | |
exit 1 |