Skip to content

Commit

Permalink
Try shit
Browse files Browse the repository at this point in the history
  • Loading branch information
flipbit03 committed Dec 31, 2024
1 parent 5ba681e commit 2fdf837
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
39 changes: 39 additions & 0 deletions .github/actions/cache_deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Install and cache poetry/pre-commit dependencies

runs:
using: "composite"
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up python
id: setup-python
uses: actions/setup-python@v5

- name: Install poetry
run: |
python -m pip install poetry
- name: Load cached poetry virtualenv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/actions/cache_deps.yml') }}-${{ steps.setup-python.outputs.python-version }}

- name: Install poetry dependencies, only if cache wasn't found
run: |
poetry install --no-interaction
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Load cached pre-commit virtualenv
id: cached-pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('.github/actions/cache_deps.yml') }}-${{ steps.setup-python.outputs.python-version }}

- name: Install pre-commit hooks, only if cache wasn't found
run: |
poetry run pre-commit install-hooks
if: steps.cached-pre-commit.outputs.cache-hit != 'true'
10 changes: 1 addition & 9 deletions .github/workflows/lints_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4

- name: Install dependencies
run: |
python -m pip install poetry
poetry install
- uses: ./.github/actions/cache_deps.yml

- name: Static type checking with `mypy`
run: |
poetry run mypy
- name: Linting with `pre-commit` and `ruff`
run: |
poetry run pre-commit run --all-files --show-diff-on-failure
2 changes: 1 addition & 1 deletion cadurso/system.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import inspect
import logging
from typing import Callable, Hashable, Self, cast
from typing import Callable, Hashable, cast

from cadurso.errors import (
ERROR_AUTH_FUNC_ACTION_NOT_HASHABLE,
Expand Down

0 comments on commit 2fdf837

Please sign in to comment.