Skip to content

Commit

Permalink
Streamline cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandines committed Jan 27, 2024
1 parent 2bab1fb commit 6adfddd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ jobs:
uses: nathandines/calibre-template-functions/.github/workflows/run_in_pyenv.yml@main
with:
run_command: poetry run mypy .
cached: true
linter-ruff:
needs: [python-deps]
uses: nathandines/calibre-template-functions/.github/workflows/run_in_pyenv.yml@main
with:
run_command: poetry run ruff check --output-format=github .
cached: true
formatter-ruff:
needs: [python-deps]
uses: nathandines/calibre-template-functions/.github/workflows/run_in_pyenv.yml@main
with:
run_command: poetry run ruff format --check .
cached: true
tests-pytest:
needs: [python-deps]
uses: nathandines/calibre-template-functions/.github/workflows/run_in_pyenv.yml@main
with:
run_command: poetry run pytest -v --cov=. .
cached: true
11 changes: 9 additions & 2 deletions .github/workflows/run_in_pyenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@ on:
required: false
description: Command to run in pyenv
type: string
cached:
required: false
default: false
description: Whether to rely on cached dependencies (i.e. don't run Poetry)
type: boolean

jobs:
pyenv-workflow:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- if: ${{ ! inputs.cached }}
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
cache: poetry
- run: poetry install
- if: ${{ ! inputs.cached }}
run: poetry install
- if: ${{ inputs.run_command != '' }}
run: ${{ inputs.run_command }}

0 comments on commit 6adfddd

Please sign in to comment.