From 120d500bbc0ae778d692e2620a2b03e24a1334bf Mon Sep 17 00:00:00 2001 From: nikitaazanov Date: Tue, 12 Sep 2023 10:13:54 +0700 Subject: [PATCH] Update GitHub CI --- .github/workflows/checks.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 725d134..d7b27c9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -24,23 +24,29 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} + id: install-python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install poetry - run: | - curl -sSL \ - "https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py" | python - - # Adding `poetry` to `$PATH`: - echo "$HOME/.poetry/bin" >> $GITHUB_PATH + - name: Install Poetry + uses: snok/install-poetry@v1.3.3 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Cache poetry dependencies + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: ${{ runner.os }}-${{ steps.install-python.outputs.python-version }}-${{ github.job }}-poetry-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies - run: | - poetry config virtualenvs.in-project true - poetry run pip install -U pip - poetry install + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --only="test" - name: Run pre-commit hooks uses: pre-commit/action@v3.0.0