Skip to content

Commit

Permalink
ci(check): use native poetry dependency cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijas authored Sep 25, 2023
1 parent fea5125 commit 1959801
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,35 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: poetry.lock

# Tool Installation
- name: Load cached tool installations
id: cached-tools
uses: actions/cache@v3
with:
path: ~/.local/bin # the path depends on the OS
key: tools-${{ matrix.python-version }}-1 # Increment cache key to clear cache
- name: Install Poetry
if: steps.cached-tools.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
- name: Check Poetry location
run: which poetry
- name: Install Task
run: |
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
# Dependency Installation
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: ~/.cache/pypoetry/virtualenvs
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
run: poetry install --no-interaction --no-root

# CI/CD Checks
- name: Run CI-CD-checks
Expand Down

0 comments on commit 1959801

Please sign in to comment.