From 88689a67786f02012f937420831ba38032262aed Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 14:27:18 +0200 Subject: [PATCH 01/29] Do we still need the more aggresive caching? --- .github/workflows/django.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 9a5ced11..3999eaff 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -36,14 +36,6 @@ jobs: cache-dependency-path: | requirements/local.txt requirements/base.txt - # This is a more aggresive cache. - # The one above caches the wheel files, but still runs the installation for them - # While the cache below caches the entire Python directory. - - name: Cache pip - uses: actions/cache@v4 - with: - path: /opt/hostedtoolcache/Python/3.12.4/x64/ # This path is specific to Ubuntu - key: python-${{ hashFiles('requirements/local.txt') }}-${{ hashFiles('requirements/base.txt') }} - name: Install dependencies run: pip install -r requirements/local.txt - name: Run ruff From 10c55b07ed61d04d5ee607eb39428fd2a210b6b1 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 14:34:04 +0200 Subject: [PATCH 02/29] Can we install dependencies in a different job? --- .github/workflows/django.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 3999eaff..30db90a2 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -14,8 +14,23 @@ jobs: - name: Run tests run: docker compose run django py.test + install_dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12.4 + cache: "pip" + cache-dependency-path: | + requirements/local.txt + requirements/base.txt + - name: Install dependencies + run: pip install -r requirements/local.txt + build: runs-on: ubuntu-latest + needs: install_dependencies services: postgres: image: postgres:latest @@ -29,15 +44,6 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12.4 - cache: "pip" - cache-dependency-path: | - requirements/local.txt - requirements/base.txt - - name: Install dependencies - run: pip install -r requirements/local.txt - name: Run ruff run: ruff check . - name: Type check From e0b9c707997ba365e38da3845f6d756378ace2e7 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 15:57:22 +0200 Subject: [PATCH 03/29] Lets have a reusable (composite) action --- .github/workflows/django.yml | 17 +++-------------- .github/workflows/python_and_pip.yml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/python_and_pip.yml diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 30db90a2..b5880e0b 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -14,20 +14,6 @@ jobs: - name: Run tests run: docker compose run django py.test - install_dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12.4 - cache: "pip" - cache-dependency-path: | - requirements/local.txt - requirements/base.txt - - name: Install dependencies - run: pip install -r requirements/local.txt - build: runs-on: ubuntu-latest needs: install_dependencies @@ -45,6 +31,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Run ruff + - uses: ./.github/workflows/python_and_pip.yml" + with: + python-version: 3.12.4 run: ruff check . - name: Type check run: mypy --config mypy.ini styleguide_example/ diff --git a/.github/workflows/python_and_pip.yml b/.github/workflows/python_and_pip.yml new file mode 100644 index 00000000..9871f551 --- /dev/null +++ b/.github/workflows/python_and_pip.yml @@ -0,0 +1,18 @@ +name: "Install & Cache Python dependencies" +description: "Reusable step (aka 'composite action') for doing pip installs, with cache included." +inputs: + python-version: + description: "The version of Python to install" + required: true +run: + using: "composite" + steps: + - uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + cache: "pip" + cache-dependency-path: | + requirements/local.txt + requirements/base.txt + - name: Install dependencies + run: pip install -r requirements/local.txt From 7a5102acdac86444bc3bb238a34d01d583409b96 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 15:58:01 +0200 Subject: [PATCH 04/29] yml --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index b5880e0b..0a377646 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -30,10 +30,10 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - - name: Run ruff - uses: ./.github/workflows/python_and_pip.yml" with: python-version: 3.12.4 + - name: Run ruff run: ruff check . - name: Type check run: mypy --config mypy.ini styleguide_example/ From d70780f63f578358aefdd3b3c3f07a57d4169ff0 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 15:58:20 +0200 Subject: [PATCH 05/29] `build` no longer `needs` --- .github/workflows/django.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 0a377646..1c14fdb6 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -16,7 +16,6 @@ jobs: build: runs-on: ubuntu-latest - needs: install_dependencies services: postgres: image: postgres:latest From 0ed897a3d4654a03918bd492e487fe64b41dacf8 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:01:38 +0200 Subject: [PATCH 06/29] Perhaps composite actions need to be in a folder with `action.yml`? --- .github/workflows/django.yml | 2 +- .../workflows/{python_and_pip.yml => python_and_pip/action.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{python_and_pip.yml => python_and_pip/action.yml} (100%) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 1c14fdb6..4d493362 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,7 +29,7 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - - uses: ./.github/workflows/python_and_pip.yml" + - uses: ./.github/workflows/python_and_pip" with: python-version: 3.12.4 - name: Run ruff diff --git a/.github/workflows/python_and_pip.yml b/.github/workflows/python_and_pip/action.yml similarity index 100% rename from .github/workflows/python_and_pip.yml rename to .github/workflows/python_and_pip/action.yml From b9f57f8de6d23aa75d1a72700b85600ee67b49cf Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:03:19 +0200 Subject: [PATCH 07/29] Specify the full path --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 4d493362..858397bf 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,7 +29,7 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - - uses: ./.github/workflows/python_and_pip" + - uses: ./.github/workflows/python_and_pip/action.yml" with: python-version: 3.12.4 - name: Run ruff From a7bed6fce369115a8e89dcde2fed615910b6f17b Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:06:07 +0200 Subject: [PATCH 08/29] ls --- .github/workflows/django.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 858397bf..af3eaf56 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,6 +29,7 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 + - run: ls ./github/workflows/python_and_pip/ - uses: ./.github/workflows/python_and_pip/action.yml" with: python-version: 3.12.4 From 329376653b6ada786cd6d43d56cd9a4ee8e666ab Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:07:58 +0200 Subject: [PATCH 09/29] lsls --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index af3eaf56..81765af5 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,7 +29,7 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - - run: ls ./github/workflows/python_and_pip/ + - run: ls - uses: ./.github/workflows/python_and_pip/action.yml" with: python-version: 3.12.4 From b371f23fb702e15702fad89ce26cc4e5a239da47 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:12:24 +0200 Subject: [PATCH 10/29] fetch-depth --- .github/workflows/django.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 81765af5..7f276606 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -1,18 +1,18 @@ name: Django application on: [push] jobs: - docker_build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build docker - run: docker compose build - - name: Run ruff - run: docker compose run django ruff check styleguide_example/ - - name: Run mypy - run: docker compose run django mypy --config mypy.ini styleguide_example/ - - name: Run tests - run: docker compose run django py.test + # docker_build: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Build docker + # run: docker compose build + # - name: Run ruff + # run: docker compose run django ruff check styleguide_example/ + # - name: Run mypy + # run: docker compose run django mypy --config mypy.ini styleguide_example/ + # - name: Run tests + # run: docker compose run django py.test build: runs-on: ubuntu-latest @@ -29,6 +29,8 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 + - with: + fetch-depth: 0 - run: ls - uses: ./.github/workflows/python_and_pip/action.yml" with: From 679be5b4b680f5dd7ed946e3fe07b100c3c44a29 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:12:58 +0200 Subject: [PATCH 11/29] yml --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 7f276606..e1358e5c 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,7 +29,7 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - - with: + with: fetch-depth: 0 - run: ls - uses: ./.github/workflows/python_and_pip/action.yml" From 6f8cd39c78051ba706db70c69c0582d0bbeded28 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:14:25 +0200 Subject: [PATCH 12/29] ls --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index e1358e5c..d0e99e7d 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: ls + - run: ls .github - uses: ./.github/workflows/python_and_pip/action.yml" with: python-version: 3.12.4 From f1b66d258d231223cc34cffb4f5f1efe284d82cc Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:15:23 +0200 Subject: [PATCH 13/29] paths are hard --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index d0e99e7d..0bd9fbf8 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - run: ls .github - - uses: ./.github/workflows/python_and_pip/action.yml" + - uses: .github/workflows/python_and_pip/action.yml" with: python-version: 3.12.4 - name: Run ruff From 95287ea32758312208d6e7896bcf87ffb1a5b8c0 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:16:51 +0200 Subject: [PATCH 14/29] " --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 0bd9fbf8..c3d7686d 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - run: ls .github - - uses: .github/workflows/python_and_pip/action.yml" + - uses: ".github/workflows/python_and_pip/action.yml" with: python-version: 3.12.4 - name: Run ruff From 04ef09804c9f416b0b84f6fe34371bfb360d7751 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:17:47 +0200 Subject: [PATCH 15/29] paths are hard v2 --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index c3d7686d..96642d49 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - run: ls .github - - uses: ".github/workflows/python_and_pip/action.yml" + - uses: ./.github/workflows/python_and_pip/action.yml with: python-version: 3.12.4 - name: Run ruff From 17c9806ce4bf1c09088779d8258f5ba4d4098eb1 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:18:50 +0200 Subject: [PATCH 16/29] paths are hard v3 --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 96642d49..31ab29ef 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - run: ls .github - - uses: ./.github/workflows/python_and_pip/action.yml + - uses: .github/workflows/python_and_pip/action.yml with: python-version: 3.12.4 - name: Run ruff From 5071263ae1387808db368d7c573217a27fc99d61 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:20:01 +0200 Subject: [PATCH 17/29] more paths --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 31ab29ef..b8e25a4d 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - run: ls .github - - uses: .github/workflows/python_and_pip/action.yml + - uses: ./.github/workflows/python_and_pip with: python-version: 3.12.4 - name: Run ruff From 67d2dff0ea927bd0a8f5877d8a85eb43435f9902 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:22:08 +0200 Subject: [PATCH 18/29] runs --- .github/workflows/python_and_pip/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python_and_pip/action.yml b/.github/workflows/python_and_pip/action.yml index 9871f551..5d88851e 100644 --- a/.github/workflows/python_and_pip/action.yml +++ b/.github/workflows/python_and_pip/action.yml @@ -1,10 +1,12 @@ name: "Install & Cache Python dependencies" description: "Reusable step (aka 'composite action') for doing pip installs, with cache included." + inputs: python-version: description: "The version of Python to install" required: true -run: + +runs: using: "composite" steps: - uses: actions/setup-python@v5 From 57c552898960de2352c384999476e224ee7bbbc4 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:26:55 +0200 Subject: [PATCH 19/29] shell --- .github/workflows/python_and_pip/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python_and_pip/action.yml b/.github/workflows/python_and_pip/action.yml index 5d88851e..ddcec9f7 100644 --- a/.github/workflows/python_and_pip/action.yml +++ b/.github/workflows/python_and_pip/action.yml @@ -18,3 +18,4 @@ runs: requirements/base.txt - name: Install dependencies run: pip install -r requirements/local.txt + shell: bash From 5b0a637ec3a9f4c91ebfba6b8d9c5dd789a2a49a Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:29:23 +0200 Subject: [PATCH 20/29] no fetch-depth needed --- .github/workflows/django.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index b8e25a4d..a10a44b5 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,9 +29,6 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - run: ls .github - uses: ./.github/workflows/python_and_pip with: python-version: 3.12.4 From 00ca3ee93940d1b17c1533d1b5fb2217608a66e1 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Fri, 31 Jan 2025 16:31:32 +0200 Subject: [PATCH 21/29] Simplify --- .github/workflows/django.yml | 2 -- .github/workflows/python_and_pip/action.yml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index a10a44b5..ba9d3915 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -30,8 +30,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/workflows/python_and_pip - with: - python-version: 3.12.4 - name: Run ruff run: ruff check . - name: Type check diff --git a/.github/workflows/python_and_pip/action.yml b/.github/workflows/python_and_pip/action.yml index ddcec9f7..2779c35a 100644 --- a/.github/workflows/python_and_pip/action.yml +++ b/.github/workflows/python_and_pip/action.yml @@ -5,6 +5,7 @@ inputs: python-version: description: "The version of Python to install" required: true + default: "3.12.4" runs: using: "composite" From 13f118f00cfb976f56e5233b34a365a257bd0517 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:03:35 +0200 Subject: [PATCH 22/29] Add new `lint_and_format` build step --- .github/workflows/django.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index ba9d3915..94b5b980 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -14,6 +14,16 @@ jobs: # - name: Run tests # run: docker compose run django py.test + lint_and_format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/python_and_pip + - name: Run ruff linter + run: ruff check . + - name: Run ruff format checker + run: ruff format --check + build: runs-on: ubuntu-latest services: From c585e2949edb94bff7931d21bca78a7982980560 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:06:01 +0200 Subject: [PATCH 23/29] Add `typecheck` and `tests` build steps --- .github/workflows/django.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 94b5b980..75b1f8f2 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -24,7 +24,15 @@ jobs: - name: Run ruff format checker run: ruff format --check - build: + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/python_and_pip + - name: Type check + run: mypy --config mypy.ini styleguide_example/ + + tests: runs-on: ubuntu-latest services: postgres: @@ -40,17 +48,13 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/workflows/python_and_pip - - name: Run ruff - run: ruff check . - - name: Type check - run: mypy --config mypy.ini styleguide_example/ - name: Run tests run: pytest deploy_to_heroku: runs-on: ubuntu-latest - needs: build - # The project is currently hosted on render.com + needs: [lint_and_format, typecheck, tests] + # The project is currently not hosted anywhere if: false steps: - uses: actions/checkout@v4 From 3f78f25ab2d11f8165193767b92c4f48990d5888 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:09:25 +0200 Subject: [PATCH 24/29] Add `pytest-split` as a new requirement --- requirements/local.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/local.txt b/requirements/local.txt index 2360c33b..1e5fa0a5 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -19,3 +19,4 @@ boto3-stubs==1.36.6 ruff==0.9.3 pre-commit==4.1.0 +pytest-split==0.10.0 From ab700054e9ee0af577beff5b06888a152a1d71d6 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:11:59 +0200 Subject: [PATCH 25/29] Run `pytest` with `--nomigrations` to check the effect --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 75b1f8f2..c4bc90aa 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/workflows/python_and_pip - name: Run tests - run: pytest + run: pytest --nomigrations deploy_to_heroku: runs-on: ubuntu-latest From b2fe27b66f82d83073a1525d15286fc54bb3b4bd Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:19:03 +0200 Subject: [PATCH 26/29] Lets run in parallel and see --- .github/workflows/django.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index c4bc90aa..d7a8a0c7 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -33,6 +33,10 @@ jobs: run: mypy --config mypy.ini styleguide_example/ tests: + strategy: + fail-fast: true + matrix: + groups: [1, 2, 3, 4, 5] runs-on: ubuntu-latest services: postgres: @@ -49,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/workflows/python_and_pip - name: Run tests - run: pytest --nomigrations + run: pytest -s -n auto --splits 5 --group ${{ matrix.groups }} --splitting-algorithm least_duration deploy_to_heroku: runs-on: ubuntu-latest From e8fcfbbe9a696fcfe30936fc5f92a2f85e371130 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:19:34 +0200 Subject: [PATCH 27/29] `matrix` is under `strategy` --- .github/workflows/django.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index d7a8a0c7..4bce6c0d 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -35,8 +35,8 @@ jobs: tests: strategy: fail-fast: true - matrix: - groups: [1, 2, 3, 4, 5] + matrix: + groups: [1, 2, 3, 4, 5] runs-on: ubuntu-latest services: postgres: From ff56443338cf28ae0d678f2298c634fa07290339 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:22:21 +0200 Subject: [PATCH 28/29] `-n auto` is from `pytest-xdist` --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 4bce6c0d..290a36fb 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/workflows/python_and_pip - name: Run tests - run: pytest -s -n auto --splits 5 --group ${{ matrix.groups }} --splitting-algorithm least_duration + run: pytest -s --splits 5 --group ${{ matrix.groups }} --splitting-algorithm least_duration deploy_to_heroku: runs-on: ubuntu-latest From b0c4338134df4707c4f15ba5404c3fee004f66b3 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Sat, 1 Feb 2025 11:24:10 +0200 Subject: [PATCH 29/29] 2 groups make more sense --- .github/workflows/django.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 290a36fb..1be12bf2 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: true matrix: - groups: [1, 2, 3, 4, 5] + groups: [1, 2] runs-on: ubuntu-latest services: postgres: @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/workflows/python_and_pip - name: Run tests - run: pytest -s --splits 5 --group ${{ matrix.groups }} --splitting-algorithm least_duration + run: pytest --splits 2 --group ${{ matrix.groups }} --splitting-algorithm least_duration deploy_to_heroku: runs-on: ubuntu-latest