Skip to content

Commit

Permalink
Use built in caching for python setup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReverend403 committed Mar 21, 2024
1 parent 90c7250 commit 9f524ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
if: github.event_name != 'pull_request'
if: github.event_name != "pull_request"
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -49,10 +49,10 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != "pull_request" }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
META_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
META_VERSION_HASH=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
META_SOURCE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.source'] }}
META_VERSION=${{ fromJSON(steps.meta.outputs.json).labels["org.opencontainers.image.version"] }}
META_VERSION_HASH=${{ fromJSON(steps.meta.outputs.json).labels["org.opencontainers.image.revision"] }}
META_SOURCE=${{ fromJSON(steps.meta.outputs.json).labels["org.opencontainers.image.source"] }}
12 changes: 2 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"

- name: Install Poetry
uses: Gr1N/setup-poetry@v9

- name: Cache virtualenv
uses: actions/cache@v4
id: cache
with:
path: ~/.cache/pypoetry/virtualenvs
key: poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
- name: Install Python dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: Lint
uses: pre-commit/action@v3.0.0

0 comments on commit 9f524ec

Please sign in to comment.