Skip to content

Commit

Permalink
Move poetry-cache-id default into action
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Sep 25, 2023
1 parent 5fd4207 commit c3f28d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/actions/install-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ inputs:
python-version:
required: true
description: Python version to install
reference:
required: true
poetry-cache-id:
default: ${{ github.event.pull_request.id || github.event.after }}
description: >
Reference ID to use for defining poetry cache (e.g. pull request id
or commit SHA)
Expand All @@ -19,7 +19,7 @@ runs:
uses: actions/cache@v3
with:
path: ~/.local
key: ${{ runner.os }}-poetry-${{ inputs.reference }}
key: ${{ runner.os }}-poetry-${{ inputs.poetry-cache-id }}
- name: Install Poetry
uses: snok/install-poetry@v1
if: steps.cached-poetry.outputs.cache-hit != 'true'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
uses: ./.github/actions/install-project
with:
python-version: '3.11'
reference: ${{ github.event.pull_request.id || github.event.after }}

# run python style checks
- name: Poetry Lock Check
Expand All @@ -50,7 +49,6 @@ jobs:
- uses: ./.github/actions/install-project
with:
python-version: ${{ matrix.python-version }}
reference: ${{ github.event.pull_request.id || github.event.after }}

test:
runs-on: ubuntu-latest
Expand All @@ -67,7 +65,6 @@ jobs:
uses: ./.github/actions/install-project
with:
python-version: ${{ matrix.python-version }}
reference: ${{ github.event.pull_request.id || github.event.after }}

- name: Test with pytest
env:
Expand Down

0 comments on commit c3f28d4

Please sign in to comment.