From 2e1f27862172200c22dcd30a8be37bd2b414d7d8 Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 10:43:45 +0500 Subject: [PATCH 01/11] Cache poetry deps during CI runs --- .github/workflows/app.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index d5d13d3..61f660b 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -35,9 +35,10 @@ jobs: - uses: actions/checkout@v3 - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 + cache: "poetry" - name: Install Poetry uses: snok/install-poetry@v1 @@ -58,9 +59,10 @@ jobs: - uses: actions/checkout@v3 - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 + cache: "poetry" - name: Install Poetry uses: snok/install-poetry@v1 From 4b8c0389bf262224df073cc2fd608c3b97772c43 Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 10:47:59 +0500 Subject: [PATCH 02/11] Test run --- .github/workflows/app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 61f660b..bec8df8 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -4,7 +4,7 @@ on: push: branches: [main, development] pull_request: - branches: [main, development] + branches: [main, development, '109-cache-poetry-deps'] jobs: changes: @@ -38,7 +38,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.9 - cache: "poetry" + #cache: "poetry" - name: Install Poetry uses: snok/install-poetry@v1 From e96528411859c0d95d0d979a900c7e3665df1f39 Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 10:51:41 +0500 Subject: [PATCH 03/11] Test run --- .github/workflows/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index bec8df8..aa0dc65 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -28,7 +28,7 @@ jobs: pytest: needs: changes - if: ${{ needs.changes.outputs.py_modified == 'true' }} + #if: ${{ needs.changes.outputs.py_modified == 'true' }} runs-on: ubuntu-latest steps: From c4626d341e8916b81c8df1df0f50725e0be278aa Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 10:53:45 +0500 Subject: [PATCH 04/11] Test run --- .github/workflows/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index aa0dc65..0441f0f 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -52,7 +52,7 @@ jobs: flake8: needs: changes - if: ${{ needs.changes.outputs.py_modified == 'true' }} + #if: ${{ needs.changes.outputs.py_modified == 'true' }} runs-on: ubuntu-latest steps: From 5c9acb450bdcd5860d85811f4a5c7b90c3d0eb5d Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 10:56:06 +0500 Subject: [PATCH 05/11] Test run --- .github/workflows/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 0441f0f..c0a96c4 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -62,7 +62,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.9 - cache: "poetry" + #cache: "poetry" - name: Install Poetry uses: snok/install-poetry@v1 From f6683cc3c12c7a909e55a47d1e914a812629c81c Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 11:00:58 +0500 Subject: [PATCH 06/11] Test run --- .github/workflows/app.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index c0a96c4..1dd0f62 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -34,14 +34,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install poetry + run: pipx install poetry + - name: Setup python uses: actions/setup-python@v5 with: python-version: 3.9 - #cache: "poetry" - - - name: Install Poetry - uses: snok/install-poetry@v1 + cache: "poetry" - name: Install dependencies run: poetry install @@ -58,11 +58,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install poetry + run: pipx install poetry + - name: Setup python uses: actions/setup-python@v5 with: python-version: 3.9 - #cache: "poetry" + cache: "poetry" - name: Install Poetry uses: snok/install-poetry@v1 From 5353f10bb0f6ce104e5bc3aea1cecbbe19f0705d Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 11:02:58 +0500 Subject: [PATCH 07/11] Test run --- .github/workflows/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 1dd0f62..eb7c979 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -27,7 +27,7 @@ jobs: - added|modified: "./**/*.py" pytest: - needs: changes + needs: flake8 #if: ${{ needs.changes.outputs.py_modified == 'true' }} runs-on: ubuntu-latest From e258bf4cebae98cb28309e52418e386b209b6ea4 Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 11:05:23 +0500 Subject: [PATCH 08/11] Test run --- .github/workflows/app.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index eb7c979..12e55a2 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -67,9 +67,6 @@ jobs: python-version: 3.9 cache: "poetry" - - name: Install Poetry - uses: snok/install-poetry@v1 - - name: Install dependencies run: poetry install From 48c5ef990dc7680861881afd8f62797b53d4cc52 Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 11:13:26 +0500 Subject: [PATCH 09/11] Test run --- .github/workflows/app.yml | 52 +++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 12e55a2..eaee9a5 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -46,30 +46,34 @@ jobs: - name: Install dependencies run: poetry install - - name: run + - name: Style check run: | - poetry run python -m pytest tests - - flake8: - needs: changes - #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@v5 - with: - python-version: 3.9 - cache: "poetry" - - - name: Install dependencies - run: poetry install + poetry run flake8 ${{ needs.changes.outputs.py_modified_files }} - - name: run + - name: Tests run: | - poetry run flake8 ${{ needs.changes.outputs.py_modified_files }} + poetry run python -m pytest tests + +# flake8: +# needs: changes +# #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@v5 +# with: +# python-version: 3.9 +# cache: "poetry" +# +# - name: Install dependencies +# run: poetry install +# +# - name: run +# run: | +# poetry run flake8 ${{ needs.changes.outputs.py_modified_files }} From 1c2e064fd6d16d34a376066420889563b8f3fa5b Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 11:14:01 +0500 Subject: [PATCH 10/11] Test run --- .github/workflows/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index eaee9a5..d4b7935 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -27,7 +27,7 @@ jobs: - added|modified: "./**/*.py" pytest: - needs: flake8 + needs: changes #if: ${{ needs.changes.outputs.py_modified == 'true' }} runs-on: ubuntu-latest From ff18d47e352aeadfdb99b909be999a60765aff7d Mon Sep 17 00:00:00 2001 From: Andrey Atapin Date: Fri, 5 Jul 2024 11:45:33 +0500 Subject: [PATCH 11/11] with setup --- .github/workflows/app.yml | 67 +++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index d4b7935..9955ef5 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -26,10 +26,29 @@ jobs: py_modified: - added|modified: "./**/*.py" - pytest: + setup: needs: changes #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@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 @@ -54,26 +73,26 @@ jobs: run: | poetry run python -m pytest tests -# flake8: -# needs: changes -# #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@v5 -# with: -# python-version: 3.9 -# cache: "poetry" -# -# - name: Install dependencies -# run: poetry install -# -# - name: run -# run: | -# poetry run flake8 ${{ needs.changes.outputs.py_modified_files }} + flake8: + 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@v5 + with: + python-version: 3.9 + cache: "poetry" + + - name: Install dependencies + run: poetry install + + - name: run + run: | + poetry run flake8 ${{ needs.changes.outputs.py_modified_files }}