From a9b07578d2443a1e2705cbb460dcc966bfb20740 Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Sun, 28 May 2023 22:29:28 -0700 Subject: [PATCH] install project for pre-commit workflow so creosote can access the venv --- .github/workflows/pre-commit.yaml | 34 ++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 3bb8c2a..40365e2 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -17,5 +17,37 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + + - name: Cache $HOME/.local # Significantly speeds up Poetry Install + uses: actions/cache@v3 + with: + path: ~/.local + key: dotlocal-${{ runner.os }}-${{ hashFiles('.github/workflows/tests.yml') }} + + - uses: actions/setup-python@v4 + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: pip-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }} + restore-keys: ${{ runner.os }}-pip + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install Belay + run: poetry install --no-interaction + - uses: pre-commit/action@v2.0.3