Skip to content

Improve timing of tick_tock() and allow stopping on terminal state (#… #21

Improve timing of tick_tock() and allow stopping on terminal state (#…

Improve timing of tick_tock() and allow stopping on terminal state (#… #21

################################################################################
# Ensure poetry and tox installed dependencies are in the cache.
#
# All PR's can reuse devel's caches, but a PR's cache cannot be reused from
# one PR to the next. This jobs' sole purpose is to make sure every PR updates
# devel's cache (if changes are needed) on merging.
#
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
################################################################################
name: update-poetry-cache
on:
push:
branches:
- devel
workflow_dispatch:
jobs:
update-poetry-cache:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.10"]
include:
- python-version: "3.8"
python-py-version: "py38"
- python-version: "3.10"
python-py-version: "py310"
container:
image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Poetry Venv Dir
run: |
echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV
- name: Restore the Cache
id: cache-deps
uses: actions/cache@v3
with:
path: ${{ env.VENV_DIR }}
# bump the suffix if you need to force-refresh the cache
key: py-trees-ci-cache-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock', '**/tox.ini') }}-1
# Install all deps, sans the project (--no-root)
- name: Poetry - Install Dependencies
run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Tox - Install Dependencies
run: poetry run tox --workdir ${{ env.VENV_DIR }} --notest -e ${{ matrix.python-py-version }} check my${{ matrix.python-py-version }}
if: steps.cache-deps.outputs.cache-hit != 'true'