Skip to content

Commit 742972a

Browse files
committed
[chores] Cache CI bot dependencies #628
1 parent e1d24be commit 742972a

8 files changed

Lines changed: 29 additions & 0 deletions

.github/actions/bot-changelog-generator/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,24 @@ inputs:
1515
repo-name:
1616
description: "Repository name in format owner/repo"
1717
required: true
18+
cache-dependency-path:
19+
description: "Path to dependency metadata used for pip cache invalidation"
20+
required: false
21+
default: ""
1822

1923
runs:
2024
using: "composite"
2125
steps:
26+
- name: Set up Python with cache
27+
if: ${{ inputs.cache-dependency-path != '' }}
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.13"
31+
cache: "pip"
32+
cache-dependency-path: ${{ inputs.cache-dependency-path }}
33+
2234
- name: Set up Python
35+
if: ${{ inputs.cache-dependency-path == '' }}
2336
uses: actions/setup-python@v5
2437
with:
2538
python-version: "3.13"

.github/workflows/bot-autoassign-issue.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
uses: actions/setup-python@v6
3232
with:
3333
python-version: "3.13"
34+
cache: "pip"
35+
cache-dependency-path: "setup.py"
3436

3537
- name: Install dependencies
3638
run: pip install -e .[github_actions]

.github/workflows/bot-autoassign-pr-issue-link.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/setup-python@v6
3333
with:
3434
python-version: "3.13"
35+
cache: "pip"
36+
cache-dependency-path: "setup.py"
3537

3638
- name: Install dependencies
3739
run: pip install -e .[github_actions]

.github/workflows/bot-autoassign-pr-reopen.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
uses: actions/setup-python@v6
3535
with:
3636
python-version: "3.13"
37+
cache: "pip"
38+
cache-dependency-path: "setup.py"
3739

3840
- name: Install dependencies
3941
run: pip install -e .[github_actions]
@@ -65,6 +67,8 @@ jobs:
6567
uses: actions/setup-python@v6
6668
with:
6769
python-version: "3.13"
70+
cache: "pip"
71+
cache-dependency-path: "setup.py"
6872

6973
- name: Install dependencies
7074
run: pip install -e .[github_actions]

.github/workflows/bot-autoassign-stale-pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/setup-python@v6
3333
with:
3434
python-version: "3.13"
35+
cache: "pip"
36+
cache-dependency-path: "setup.py"
3537

3638
- name: Install dependencies
3739
run: pip install -e .[github_actions]

.github/workflows/reusable-bot-autoassign.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
uses: actions/setup-python@v6
3636
with:
3737
python-version: "3.13"
38+
cache: "pip"
39+
cache-dependency-path: "openwisp-utils/setup.py"
3840

3941
- name: Install dependencies
4042
run: pip install -e 'openwisp-utils/.[github_actions]'

.github/workflows/reusable-bot-changelog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ jobs:
6363
ref: master
6464
sparse-checkout: |
6565
.github/actions/bot-changelog-generator
66+
setup.py
6667
path: openwisp-utils-action
6768

6869
- name: Generate changelog
6970
if: steps.check-commits.outputs.has_noteworthy == 'true'
7071
uses: ./openwisp-utils-action/.github/actions/bot-changelog-generator
7172
with:
73+
cache-dependency-path: openwisp-utils-action/setup.py
7274
github-token: ${{ steps.app-token.outputs.token }}
7375
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
7476
pr-number: ${{ steps.check-commits.outputs.pr_number }}

.github/workflows/reusable-bot-ci-failure.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
uses: actions/setup-python@v6
6969
with:
7070
python-version: "3.13"
71+
cache: "pip"
72+
cache-dependency-path: "trusted_scripts/setup.py"
7173

7274
- name: Install Tools
7375
run: |

0 commit comments

Comments
 (0)