1818 plone-version :
1919 required : true
2020 type : string
21-
22- defaults :
23- run :
24- working-directory : backend
21+ working-directory :
22+ required : false
23+ type : string
24+ default : backend
2525
2626jobs :
2727
2828 lint :
29- runs-on : ubuntu-latest
30- steps :
31-
32- - name : Checkout
33- uses : actions/checkout@v4
34-
35- - name : Install the latest version of uv
36- uses : astral-sh/setup-uv@v5
37- with :
38- python-version : ${{ inputs.python-version }}
39- enable-cache : true
40-
41- - name : Check formatting
42- if : ${{ success() || failure() }}
43- id : ruff-format
44- run : uvx ruff@latest format --diff
45-
46- - name : Check lint
47- if : ${{ success() || failure() }}
48- id : ruff-lint
49- run : uvx ruff@latest check --diff
50-
51- - name : Check XML / ZCML
52- if : ${{ success() || failure() }}
53- id : zpretty
54- run : uvx zpretty@latest --check src
55-
56- - name : Check Package Metadata
57- if : ${{ success() || failure() }}
58- id : pyroma
59- run : uvx pyroma@latest -d .
60-
61- - name : Check Python Versions
62- if : ${{ success() || failure() }}
63- id : py-versions
64- run : uvx check-python-versions@latest .
65-
66- - name : Report
67- if : ${{ success() || failure() }}
68- run : |
69- echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
70- echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
71- echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
72- echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
73- echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
74- echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
75- echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
76- echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
29+ name : " Backend: Lint"
30+ uses : plone/meta/.github/workflows/backend-lint.yml@2.x
31+ with :
32+ python-version : ${{ inputs.python-version }}
33+ plone-version : ${{ inputs.plone-version }}
34+ working-directory : ${{ inputs.working-directory }}
7735
7836 test :
79- runs-on : ubuntu-latest
80- env :
81- PYTHON_VERSION : ${{ inputs.python-version }}
82- PLONE_VERSION : ${{ inputs.plone-version }}
83- steps :
84-
85- - name : Checkout
86- uses : actions/checkout@v4
87-
88- - name : Install the latest version of uv
89- uses : astral-sh/setup-uv@v5
90- with :
91- python-version : ${{ inputs.python-version }}
92- enable-cache : false
93-
94- - name : Restore uv cache
95- uses : actions/cache@v4
96- with :
97- path : ${{ env.UV_CACHE_DIR }}
98- key : uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
99- restore-keys : |
100- uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
101- uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}
102-
103- - name : Install Plone and package
104- run : make install
105-
106- - name : Run tests
107- run : make test
37+ name : " Backend: Test"
38+ uses : plone/meta/.github/workflows/backend-pytest.yml@2.x
39+ strategy :
40+ matrix :
41+ python-version : ["3.13", "3.12", "3.11", "3.10"]
42+ plone-version : ["6.1-latest", "6.0-latest"]
43+ with :
44+ python-version : ${{ matrix.python-version }}
45+ plone-version : ${{ matrix.plone-version }}
46+ working-directory : ${{ inputs.working-directory }}
10847
10948 coverage :
110- runs-on : ubuntu-latest
49+ name : " Backend: Coverage"
50+ uses : plone/meta/.github/workflows/backend-pytest-coverage.yml@2.x
11151 needs :
11252 - test
113- steps :
114- - name : Checkout
115- uses : actions/checkout@v4
116-
117- - name : Install the latest version of uv
118- uses : astral-sh/setup-uv@v5
119- with :
120- python-version : ${{ inputs.python-version }}
121- enable-cache : false
122-
123- - name : Restore uv cache
124- uses : actions/cache@v4
125- with :
126- path : /tmp/.uv-cache
127- key : uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
128- restore-keys : |
129- uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
130- uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}
131-
132- - name : Install Plone and package
133- run : make install
134-
135- - name : Run tests
136- run : make test-coverage
137-
138- - name : Report Coverage
139- run : |
140- echo "# Coverage Report" >> $GITHUB_STEP_SUMMARY
141- echo "$(uv run coverage report --format markdown)" >> $GITHUB_STEP_SUMMARY
53+ with :
54+ python-version : ${{ inputs.python-version }}
55+ plone-version : ${{ inputs.plone-version }}
56+ working-directory : ${{ inputs.working-directory }}
14257
14358 release :
144- runs-on : ubuntu-latest
59+ name : " Backend: Build and publish Container Image"
60+ uses : plone/meta/.github/workflows/container-image-build-push.yml@2.x
14561 needs :
14662 - lint
14763 - coverage
14864 permissions :
14965 contents : read
15066 packages : write
151-
152- steps :
153-
154- - name : Checkout
155- uses : actions/checkout@v4
156-
157- - name : Docker meta
158- id : meta
159- uses : docker/metadata-action@v5
160- with :
161- images : |
162- ${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}
163- labels : |
164- org.label-schema.docker.cmd=docker run -d -p 8080:8080 ${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}:${{ inputs.base-tag }}
165- flavor :
166- latest=false
167- tags : |
168- type=ref,event=branch
169- type=sha
170- type=raw,value=latest,enable={{is_default_branch}}
171-
172- - name : Set up QEMU
173- uses : docker/setup-qemu-action@v3
174-
175- - name : Set up Docker Buildx
176- uses : docker/setup-buildx-action@v3
177-
178- - name : Login to Container Registry
179- uses : docker/login-action@v3
180- with :
181- registry : ghcr.io
182- username : ${{ github.actor }}
183- password : ${{ secrets.GITHUB_TOKEN }}
184-
185- - name : Build and push
186- uses : docker/build-push-action@v6
187- with :
188- platforms : linux/amd64
189- context : backend/
190- file : backend/Dockerfile
191- push : ${{ github.event_name != 'pull_request' }}
192- tags : ${{ steps.meta.outputs.tags }}
193- labels : ${{ steps.meta.outputs.labels }}
194- build-args : |
195- PLONE_VERSION=${{ inputs.plone-version }}
67+ with :
68+ base-tag : ${{ inputs.base-tag }}
69+ image-name-prefix : ${{ inputs.image-name-prefix }}
70+ image-name-suffix : ${{ inputs.image-name-suffix }}
71+ working-directory : ${{ inputs.working-directory }}
72+ build-args : |
73+ PLONE_VERSION=${{ inputs.plone-version }}
74+ push : ${{ github.event_name != 'pull_request' }}
75+ secrets :
76+ username : ${{ github.actor }}
77+ password : ${{ secrets.GITHUB_TOKEN }}
0 commit comments