chore(deps): update actions/cache action to v4 #369
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
POETRY_VERSION: 1.6.1 | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Poetry | |
id: cache-poetry | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ~/.poetry | |
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2.3.0 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Cache Dependencies | |
id: cache-deps | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ${{ github.workspace }}/.venv | |
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cache-deps.cache-hit != 'true' | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install --no-interaction | |
- name: Run tests | |
run: poetry run pytest -v | |
lint: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11"] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Poetry | |
id: cache-poetry | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ~/.poetry | |
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2.3.0 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Cache Dependencies | |
id: cache-deps | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ${{ github.workspace }}/.venv | |
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cache-deps.cache-hit != 'true' | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install --no-interaction | |
pip install pre-commit==3.1.0 | |
- name: Cache pre-commit hooks | |
id: cache-pre-commit | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Install pre-commit hooks | |
if: steps.cache-pre-commit.cache-hit != 'true' | |
run: pre-commit install-hooks | |
- name: Run checks | |
run: pre-commit run -a |