Skip to content

Commit ff47483

Browse files
committed
Fix CI: bump GH Actions, replace manual cache, fix venv conflict
- actions/checkout v4 → v6, astral-sh/setup-uv v5 → v8.0.0 - Use setup-uv built-in caching instead of actions/cache - Skip venv creation in Makefile when .venv already exists (setup-uv) - Run mypy via uvx to avoid full install in lint job - Add fail-fast: false to test matrix - Fix cookiecutter template variable left in Makefile
1 parent 53d4a6d commit ff47483

4 files changed

Lines changed: 24 additions & 33 deletions

File tree

.github/workflows/changelog.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
name: "Check for change log entries"
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717
with:
1818
# Fetch all history
1919
fetch-depth: '0'
2020

2121
- name: Install the latest version of uv
22-
uses: astral-sh/setup-uv@v5
22+
uses: astral-sh/setup-uv@v8.0.0
2323
with:
2424
python-version: ${{ env.python-version }}
2525

.github/workflows/ci.yml

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
env:
77
PYTHON_VERSION: "3.12"
8-
PLONE_VERSION: "6.1.1"
8+
PLONE_VERSION: "6.1.4"
99

1010
jobs:
1111

@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515

1616
- name: Checkout
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
1818

1919
- name: Install the latest version of uv
20-
uses: astral-sh/setup-uv@v5
20+
uses: astral-sh/setup-uv@v8.0.0
2121
with:
2222
python-version: ${{ env.PYTHON_VERSION }}
2323
enable-cache: true
@@ -51,8 +51,7 @@ jobs:
5151
if: ${{ success() || failure() }}
5252
id: typing
5353
run: |
54-
make install
55-
uv run mypy src
54+
uvx mypy src
5655
5756
- name: Report
5857
if: ${{ success() || failure() }}
@@ -70,6 +69,7 @@ jobs:
7069
test:
7170
runs-on: ubuntu-latest
7271
strategy:
72+
fail-fast: false
7373
matrix:
7474
python-version: ['3.10', '3.11', '3.12', '3.13']
7575
plone-version: ['6.1-latest', '6.0-latest']
@@ -79,22 +79,17 @@ jobs:
7979
steps:
8080

8181
- name: Checkout
82-
uses: actions/checkout@v4
82+
uses: actions/checkout@v6
8383

8484
- name: Install the latest version of uv
85-
uses: astral-sh/setup-uv@v5
85+
uses: astral-sh/setup-uv@v8.0.0
8686
with:
8787
python-version: ${{ env.PYTHON_VERSION }}
88-
enable-cache: false
89-
90-
- name: Restore uv cache
91-
uses: actions/cache@v4
92-
with:
93-
path: ${{ env.UV_CACHE_DIR }}
94-
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
95-
restore-keys: |
96-
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
97-
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}
88+
cache-suffix: ${{ env.PLONE_VERSION }}-${{ env.PYTHON_VERSION }}
89+
enable-cache: true
90+
cache-dependency-glob: |
91+
pyproject.toml
92+
mx.ini
9893
9994
- name: Install Plone and package
10095
run: make install
@@ -108,22 +103,17 @@ jobs:
108103
- test
109104
steps:
110105
- name: Checkout
111-
uses: actions/checkout@v4
106+
uses: actions/checkout@v6
112107

113108
- name: Install the latest version of uv
114-
uses: astral-sh/setup-uv@v5
109+
uses: astral-sh/setup-uv@v8.0.0
115110
with:
116111
python-version: ${{ env.PYTHON_VERSION }}
117-
enable-cache: false
118-
119-
- name: Restore uv cache
120-
uses: actions/cache@v4
121-
with:
122-
path: /tmp/.uv-cache
123-
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
124-
restore-keys: |
125-
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
126-
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}
112+
cache-suffix: ${{ env.PLONE_VERSION }}-${{ env.PYTHON_VERSION }}
113+
enable-cache: true
114+
cache-dependency-glob: |
115+
pyproject.toml
116+
mx.ini
127117
128118
- name: Install Plone and package
129119
run: make install

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ endif
3434
ifdef CI
3535
UV_VENV_ARGS :=
3636
else
37-
UV_VENV_ARGS := --python={{ cookiecutter.__supported_versions_python[0] }}
37+
UV_VENV_ARGS := --python=3.12
3838
endif
3939

4040
VENV_FOLDER=$(BACKEND_FOLDER)/.venv
@@ -74,7 +74,7 @@ requirements-mxdev.txt: ## Generate constraints file
7474

7575
$(VENV_FOLDER): requirements-mxdev.txt ## Install dependencies
7676
@echo "$(GREEN)==> Install environment$(RESET)"
77-
@uv venv $(VENV_FOLDER)
77+
@if [[ -d "$(VENV_FOLDER)" ]]; then echo "$(YELLOW)==> Environment already exists at $(VENV_FOLDER)$(RESET)"; else uv venv $(UV_VENV_ARGS) $(VENV_FOLDER); fi
7878
@uv pip install -r requirements-mxdev.txt
7979

8080
.PHONY: sync

news/+ci.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated CI workflows: bumped actions/checkout to v6 and astral-sh/setup-uv to v8.0.0, replaced manual cache with setup-uv built-in caching, fixed Makefile venv creation conflict with setup-uv, and added fail-fast: false to test matrix. @ericof

0 commit comments

Comments
 (0)