Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache poetry deps during CI runs #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 39 additions & 14 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
branches: [main, development, '109-cache-poetry-deps']

jobs:
changes:
Expand All @@ -26,44 +26,69 @@ jobs:
py_modified:
- added|modified: "./**/*.py"

pytest:
setup:
needs: changes
if: ${{ needs.changes.outputs.py_modified == 'true' }}
#if: ${{ needs.changes.outputs.py_modified == 'true' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "poetry"

- name: Install dependencies
run: poetry install

pytest:
needs: setup
#if: ${{ needs.changes.outputs.py_modified == 'true' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "poetry"

- name: Install dependencies
run: poetry install

- name: run
- name: Style check
run: |
poetry run flake8 ${{ needs.changes.outputs.py_modified_files }}

- name: Tests
run: |
poetry run python -m pytest tests

flake8:
needs: changes
if: ${{ needs.changes.outputs.py_modified == 'true' }}
needs: setup
#if: ${{ needs.changes.outputs.py_modified == 'true' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install Poetry
uses: snok/install-poetry@v1
cache: "poetry"

- name: Install dependencies
run: poetry install
Expand Down
Loading