-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (120 loc) · 4.36 KB
/
ci.yml
File metadata and controls
145 lines (120 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: pytest_plone CI
on:
push:
env:
PYTHON_VERSION: "3.12"
PLONE_VERSION: "6.1.4"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v8.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
- name: Check formatting
if: ${{ success() || failure() }}
id: ruff-format
run: uvx ruff@latest format --diff
- name: Check lint
if: ${{ success() || failure() }}
id: ruff-lint
run: uvx ruff@latest check --diff
- name: Check XML / ZCML
if: ${{ success() || failure() }}
id: zpretty
run: uvx zpretty@latest --check src
- name: Check Package Metadata
if: ${{ success() || failure() }}
id: pyroma
run: uvx pyroma@latest -d .
- name: Check Python Versions
if: ${{ success() || failure() }}
id: py-versions
run: uvx check-python-versions@latest .
- name: Check typing
if: ${{ success() || failure() }}
id: typing
run: |
uvx mypy src
- name: Report
if: ${{ success() || failure() }}
run: |
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Typing | ${{ steps.typing.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
plone-version: ['6.1-latest', '6.0-latest']
env:
PYTHON_VERSION: ${{ matrix.python-version }}
PLONE_VERSION: ${{ matrix.plone-version }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v8.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}
cache-suffix: ${{ env.PLONE_VERSION }}-${{ env.PYTHON_VERSION }}
enable-cache: true
cache-dependency-glob: |
pyproject.toml
mx.ini
- name: Install Plone and package
run: make install
- name: Run tests
run: make test
coverage:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v8.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}
cache-suffix: ${{ env.PLONE_VERSION }}-${{ env.PYTHON_VERSION }}
enable-cache: true
cache-dependency-glob: |
pyproject.toml
mx.ini
- name: Install Plone and package
run: make install
- name: Run tests
run: make test-coverage
- name: Report Coverage
run: |
echo "# Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "$(uv run coverage report --format markdown)" >> $GITHUB_STEP_SUMMARY
report:
runs-on: ubuntu-latest
needs:
- lint
- test
- coverage
steps:
- name: Report
shell: bash
run: |
echo '# Report' >> $GITHUB_STEP_SUMMARY
echo '| Job | Status |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| Lint | ✅ |' >> $GITHUB_STEP_SUMMARY
echo '| Test | ✅ |' >> $GITHUB_STEP_SUMMARY
echo '| Coverage | ✅ |' >> $GITHUB_STEP_SUMMARY