From 8130b89f7a0ae58f524151eaa325e9c6357d6690 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 15:14:23 -0700 Subject: [PATCH 1/7] Add workflow to check and update requirements files This workflow runs an action on a pull request into main that compiles the requirements files; opens a pull request if changes are detected; and then exits successfully if no changes are detected or unsuccessfully if changes are detected. --- .github/workflows/pip-compile.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pip-compile.yml diff --git a/.github/workflows/pip-compile.yml b/.github/workflows/pip-compile.yml new file mode 100644 index 00000000..a7d039b0 --- /dev/null +++ b/.github/workflows/pip-compile.yml @@ -0,0 +1,29 @@ +name: Update pip-tools requirements files +on: + pull_request: + branches: [ "main" ] + + +jobs: + update-requirements-files: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code Repository + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Update requirements files + uses: UW-GAC/pip-tools-actions/update-requirements-files@v1 + with: + requirements_files: |- + requirements/requirements.in + requirements/test-requirements.in + requirements/dev-requirements.in + pr-branch-suffix: "${{ github.event.number}}" From ee479b77efa0f34ebbf3be4c58254d43c359139c Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 15:17:09 -0700 Subject: [PATCH 2/7] Use action v1.0 --- .github/workflows/pip-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-compile.yml b/.github/workflows/pip-compile.yml index a7d039b0..7227aa35 100644 --- a/.github/workflows/pip-compile.yml +++ b/.github/workflows/pip-compile.yml @@ -20,7 +20,7 @@ jobs: python-version: 3.9 - name: Update requirements files - uses: UW-GAC/pip-tools-actions/update-requirements-files@v1 + uses: UW-GAC/pip-tools-actions/update-requirements-files@v1.0 with: requirements_files: |- requirements/requirements.in From 69dd089a7b22a39135c110f315d8ee2b52ca324e Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 15:18:24 -0700 Subject: [PATCH 3/7] Use python 3.8 instead of 3.9 in action --- .github/workflows/pip-compile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pip-compile.yml b/.github/workflows/pip-compile.yml index 7227aa35..8d562fc6 100644 --- a/.github/workflows/pip-compile.yml +++ b/.github/workflows/pip-compile.yml @@ -14,10 +14,10 @@ jobs: with: ref: ${{ github.head_ref }} - - name: Set up Python 3.9 + - name: Set up Python 3.8 uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.8 - name: Update requirements files uses: UW-GAC/pip-tools-actions/update-requirements-files@v1.0 From 1848e0bae15a03a95c8c1c98419370d9e50af2a7 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:44:49 -0700 Subject: [PATCH 4/7] Use new composite action branch temporarily I updated the actions based on some bugs identified in this repo, so try again with the temporary ref. --- .github/workflows/pip-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-compile.yml b/.github/workflows/pip-compile.yml index 8d562fc6..d60d7e5a 100644 --- a/.github/workflows/pip-compile.yml +++ b/.github/workflows/pip-compile.yml @@ -20,7 +20,7 @@ jobs: python-version: 3.8 - name: Update requirements files - uses: UW-GAC/pip-tools-actions/update-requirements-files@v1.0 + uses: UW-GAC/pip-tools-actions/update-requirements-files@feature/internal-refs with: requirements_files: |- requirements/requirements.in From 85a96509b014bf67c0c06bf3aee09d1c75a48b67 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:48:51 -0700 Subject: [PATCH 5/7] Include branch name in PR title --- .github/workflows/pip-compile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pip-compile.yml b/.github/workflows/pip-compile.yml index d60d7e5a..5205aa20 100644 --- a/.github/workflows/pip-compile.yml +++ b/.github/workflows/pip-compile.yml @@ -26,4 +26,5 @@ jobs: requirements/requirements.in requirements/test-requirements.in requirements/dev-requirements.in + pr-title: Update requirements file for ${{ github.head_ref }} pr-branch-suffix: "${{ github.event.number}}" From b6a5a3ae4f4b91b6767f2c8dcdb6ff0e0b95841f Mon Sep 17 00:00:00 2001 From: amstilp <3944584+amstilp@users.noreply.github.com> Date: Tue, 28 May 2024 22:03:20 +0000 Subject: [PATCH 6/7] Compile requirements files --- requirements/test-requirements.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/requirements/test-requirements.txt b/requirements/test-requirements.txt index 7c016a59..01d2f3b1 100644 --- a/requirements/test-requirements.txt +++ b/requirements/test-requirements.txt @@ -12,10 +12,11 @@ charset-normalizer==3.3.2 # via # -c requirements/requirements.txt # requests -coverage==7.5.1 +coverage[toml]==7.5.1 # via # -r requirements/test-requirements.in # django-coverage-plugin + # pytest-cov django-coverage-plugin==3.1.0 # via -r requirements/test-requirements.in django-test-migrations==1.3.0 @@ -44,8 +45,10 @@ pluggy==1.5.0 pytest==8.2.0 # via # -r requirements/test-requirements.in + # pytest-cov # pytest-django # pytest-sugar + # pytest-xdist pytest-cov==5.0.0 # via -r requirements/test-requirements.in pytest-django==4.8.0 @@ -73,6 +76,7 @@ termcolor==2.4.0 tomli==2.0.1 # via # -c requirements/requirements.txt + # coverage # pytest types-requests==2.31.0.20240406 # via -r requirements/test-requirements.in From ec2e6cc4500cc82a1623d6e39ae005f4e530f1ab Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 15:24:01 -0700 Subject: [PATCH 7/7] Switch to using v0.1 ref for the pip-tools action --- .github/workflows/pip-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-compile.yml b/.github/workflows/pip-compile.yml index 5205aa20..131df4ff 100644 --- a/.github/workflows/pip-compile.yml +++ b/.github/workflows/pip-compile.yml @@ -20,7 +20,7 @@ jobs: python-version: 3.8 - name: Update requirements files - uses: UW-GAC/pip-tools-actions/update-requirements-files@feature/internal-refs + uses: UW-GAC/pip-tools-actions/update-requirements-files@v0.1 with: requirements_files: |- requirements/requirements.in