From 9acef0bd7a080b6ac547eeffee7e34a81fb35dc1 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 2 Apr 2022 05:01:30 -0500 Subject: [PATCH] ci(tests): Use poetry cache action --- .github/workflows/tests.yml | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a53fc37c..039d42931 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,17 +9,12 @@ jobs: matrix: python-version: [ '3.10' ] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Get full Python version - id: full-python-version - shell: bash - run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - - name: Install poetry run: | curl -O -sSL https://install.python-poetry.org/install-poetry.py @@ -30,30 +25,6 @@ jobs: - name: Add ~/.local/bin to PATH run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Get poetry cache paths from config - run: | - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV - - - name: Configure poetry - shell: bash - run: poetry config virtualenvs.in-project true - - - name: Set up cache - uses: actions/cache@v2 - id: cache - with: - path: | - .venv - ${{ env.poetry_cache_dir }} - ${{ env.poetry_virtualenvs_path }} - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cache.outputs.cache-hit == 'true' - shell: bash - run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv - - name: Install dependencies run: poetry install -E "docs test coverage lint format"