diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index a19acc2..e7efe32 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -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 diff --git a/.github/workflows/run_in_pyenv.yml b/.github/workflows/run_in_pyenv.yml index 7625e9a..e617e76 100644 --- a/.github/workflows/run_in_pyenv.yml +++ b/.github/workflows/run_in_pyenv.yml @@ -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 }}