Skip to content

Commit

Permalink
fix cache
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaDuina committed Dec 20, 2024
1 parent ef2f713 commit ec62f29
Showing 1 changed file with 29 additions and 33 deletions.
62 changes: 29 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ jobs:
with:
python-version: '3.12'

- name: Cache Poetry and Virtual Environment
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.poetry
.venv
path: .venv
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-
Expand All @@ -40,20 +38,14 @@ jobs:
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Configure Poetry to use in-project virtualenv
run: |
poetry config virtualenvs.in-project true
- name: Install dependencies with Poetry
run: |
poetry install --sync --no-interaction
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.poetry
.venv
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-
check-formatting:
runs-on: ubuntu-latest
needs: setup-environment # Waits for setup-environment to finish
Expand All @@ -67,21 +59,23 @@ jobs:
with:
python-version: '3.12'

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Restore cached Poetry and Virtual Environment
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.poetry
.venv
path: .venv
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Configure Poetry to use in-project virtualenv
run: |
poetry config virtualenvs.in-project true
- name: Check code formatting with Black
run: |
poetry run black --check .
Expand Down Expand Up @@ -109,21 +103,23 @@ jobs:
with:
python-version: '3.12'

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Restore cached Poetry and Virtual Environment
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.poetry
.venv
path: .venv
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Configure Poetry to use in-project virtualenv
run: |
poetry config virtualenvs.in-project true
- name: Run tests with pytest
run: |
poetry run pytest --maxfail=1 --disable-warnings -q
poetry run pytest --maxfail=1 --disable-warnings -q

0 comments on commit ec62f29

Please sign in to comment.