Skip to content

Commit

Permalink
feat(ci): cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich committed May 21, 2024
1 parent 0b81865 commit 7eb2921
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,32 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: cq
with:
python-version: '3.11'
cache: 'poetry'

- name: Install Poetry
run: pip install poetry

- name: Generate hash of req dependencies
id: cq
run: |
poetry export --only=lint --format=requirements.txt --output=requirements.txt
echo "hash=$(sha256sum requirements.txt | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/pip
key: ${{ runner.os }}-poetry-${{ env.hash }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Echo env
run: poetry env info

- name: Install lint dependencies
run: poetry install --only=lint --no-interaction --no-root
Expand Down Expand Up @@ -99,4 +116,4 @@ jobs:
run: poetry install --only=lint --no-interaction --no-root

- name: Check spellings
run: poetry run typos .
run: poetry run typos .

0 comments on commit 7eb2921

Please sign in to comment.