11name : Python PR
2-
2+ permissions :
3+ contents : read
34on :
45 pull_request :
56 branches : ["master"]
67 push :
78 branches : ["master"]
89concurrency :
910 group : ${{ github.workflow }}-${{ github.ref }}
10- cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
11+ cancel-in-progress : true
1112
1213
1314jobs :
15+ comment :
16+ name : Comment
17+ runs-on : ubuntu-latest
18+ permissions :
19+ pull-requests : write
20+ if : ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
21+
22+ steps :
23+ - name : Comment PR
24+ uses : thollander/actions-comment-pull-request@v3
25+ with :
26+ message : |
27+ :wave: Thank you for contributing this pull request!
28+
29+ This repository uses GitHub Actions to automatically run tests, build the project, and check code quality on each pull request.
30+ Please address _all_ issues found by these checks to ensure a smooth review process.
31+
32+ Please review our [Contribution Guidelines](https://github.com/Koen1999/suricata-check/blob/master/CONTRIBUTING.md) to learn everything you should know about contributing to our project!
33+
34+ Note that for first time contributors, action workflows have to be approved first by the maintainers before they can run.
35+ Please be patient, and a maintainer will review your PR soon! :pray:
36+
1437 test :
1538 name : Quick Test
16- runs-on : self-hosted
17-
39+ runs-on : ${{ matrix.os }}
1840 strategy :
1941 fail-fast : true
2042 matrix :
21- python-version : ["3.9", "3.13"]
43+ os : [ubuntu-latest, windows-latest]
44+ python-version : ["3.10", "3.14"]
2245
2346 steps :
24- - uses : actions/checkout@v4
47+ - uses : actions/checkout@v5
2548
2649 - name : Set up Python ${{ matrix.python-version }}
27- uses : actions/setup-python@v5
50+ uses : actions/setup-python@v6
2851 with :
2952 python-version : ${{ matrix.python-version }}
3053 cache : " pip"
3154
3255 - name : Install dependencies
3356 run : |
34- python -m pip install --upgrade pip setuptools wheel build
35- python -m pip install pytest
57+ python -m pip install --upgrade --upgrade-strategy eager pip pip-tools suricata-check[performance]
58+ pip-compile --extra test --extra ml -o requirements.txt pyproject.toml
3659 pip install -r requirements.txt
3760
38- - name : Test with pytest
39- run : |
40- pytest
41-
42- - name : Remove regex module
43- run : |
44- pip uninstall regex --yes
45-
46- - name : Test with pytest without regex module
61+ - name : Test using pytest
4762 run : |
4863 pytest
4964
5065 build :
5166 name : Build
52- runs-on : self-hosted
67+ runs-on : ${{ matrix.os }}
5368 needs :
5469 - test
5570
5671 strategy :
57- fail-fast : false
72+ fail-fast : true
5873 matrix :
59- python-version : ["3.9", "3.13"]
74+ os : [ubuntu-latest, windows-latest]
75+ python-version : ["3.10", "3.14"]
6076
6177 steps :
62- - uses : actions/checkout@v4
78+ - uses : actions/checkout@v5
6379
6480 - name : Set up Python ${{ matrix.python-version }}
65- uses : actions/setup-python@v5
81+ uses : actions/setup-python@v6
6682 with :
6783 python-version : ${{ matrix.python-version }}
6884 cache : " pip"
6985
7086 - name : Install dependencies
7187 run : |
72- python -m pip install --upgrade pip setuptools wheel build
88+ python -m pip install --upgrade --upgrade-strategy eager pip build
7389
74- - name : Build wheel and install with pip
90+ - name : Build and install with pip
7591 run : |
92+ python -m build
7693 pip install .
7794
7895 lint :
7996 name : Lint
80- runs-on : self-hosted
97+ runs-on : ubuntu-latest
8198 needs :
82- - build
99+ - test
83100
84101 strategy :
85- fail-fast : false
86- matrix :
87- python-version : ["3.9", "3.13"]
102+ fail-fast : true
88103
89104 steps :
90- - uses : actions/checkout@v4
105+ - uses : actions/checkout@v5
91106
92- - name : Set up Python ${{ matrix.python-version }}
93- uses : actions/setup-python@v5
94- with :
95- python-version : ${{ matrix.python-version }}
96- cache : " pip"
107+ - name : Set up Python
108+ uses : actions/setup-python@v6
97109
98110 - name : Install dependencies
99111 run : |
100- python -m pip install --upgrade pip setuptools wheel build
101- python -m pip install flake8 pyright black ruff
102- pip install -r requirements.txt
112+ python -m pip install --upgrade --upgrade-strategy eager pip pip-tools setuptools-git-versioning
113+ pip-compile --all-extras -o requirements-dev.txt pyproject.toml
114+ pip install -r requirements-dev .txt
103115
104116 - name : Lint with flake8
105117 run : |
@@ -117,28 +129,119 @@ jobs:
117129 run : |
118130 ruff check --output-format=github .
119131
120- docs :
121- name : Docs
122- runs-on : self-hosted
132+ test-minimal :
133+ name : Minimal Dependency Test
134+ runs-on : ${{ matrix.os }}
123135 needs :
136+ - test
137+
138+ strategy :
139+ fail-fast : true
140+ matrix :
141+ os : [ubuntu-latest, windows-latest]
142+ python-version : ["3.10", "3.14"]
143+
144+ steps :
145+ - uses : actions/checkout@v5
146+
147+ - name : Set up Python ${{ matrix.python-version }}
148+ uses : actions/setup-python@v6
149+ with :
150+ python-version : ${{ matrix.python-version }}
151+ cache : " pip"
152+
153+ - name : Install dependencies
154+ run : |
155+ python -m pip install --upgrade --upgrade-strategy eager pip uv suricata-check[performance]
156+ uv pip compile pyproject.toml --resolution lowest-direct --extra test --extra ml -o requirements-minimal.txt
157+ pip install -r requirements-minimal.txt
158+
159+ - name : Test using pytest
160+ run : |
161+ pytest
162+
163+ lint-minimal :
164+ name : Minimal Dependency Lint
165+ runs-on : ubuntu-latest
166+ needs :
167+ - test-minimal
124168 - lint
125169
126170 strategy :
127- fail-fast : false
171+ fail-fast : true
128172
129173 steps :
130- - uses : actions/checkout@v4
174+ - uses : actions/checkout@v5
131175
132- - name : Set up Python 3.13
133- uses : actions/setup-python@v5
176+ - name : Set up Python
177+ uses : actions/setup-python@v6
134178 with :
135- python-version : " 3.13 "
179+ python-version : " 3.10 "
136180 cache : " pip"
137181
138182 - name : Install dependencies
139183 run : |
140- python -m pip install --upgrade pip setuptools wheel build
141- pip install -r requirements.txt
184+ python -m pip install --upgrade --upgrade-strategy eager pip setuptools-git-versioning uv
185+ uv pip compile pyproject.toml --resolution lowest-direct --all-extras -o requirements-minimal-dev.txt
186+ pip install -r requirements-minimal-dev.txt
187+
188+ - name : Install Pyright
189+ run : |
190+ python -m pip install --upgrade --upgrade-strategy eager pyright
191+
192+ - name : Type checking with Pyright
193+ run : |
194+ python -m pyright
195+
196+ markdownlint :
197+ name : Markdownlint
198+ runs-on : ubuntu-latest
199+ needs :
200+ - lint
201+
202+ steps :
203+ - name : Checkout repository
204+ uses : actions/checkout@v5
205+
206+ - uses : dorny/paths-filter@v3
207+ id : changes
208+ with :
209+ filters : |
210+ src:
211+ - "**/*.md"
212+
213+ - name : Setup Node.js
214+ if : steps.changes.outputs.src == 'true'
215+ uses : actions/setup-node@v6
216+
217+ - name : Install markdownlint-cli2
218+ if : steps.changes.outputs.src == 'true'
219+ run : npm install -g markdownlint-cli2
220+
221+ - name : Run Markdownlint
222+ if : steps.changes.outputs.src == 'true'
223+ run : markdownlint-cli2 "**/*.md"
224+
225+ docs :
226+ name : Docs
227+ runs-on : ubuntu-latest
228+ needs :
229+ - markdownlint
230+
231+ strategy :
232+ fail-fast : true
233+
234+ steps :
235+ - uses : actions/checkout@v5
236+
237+ - name : Set up Python
238+ uses : actions/setup-python@v6
239+
240+ - name : Install dependencies
241+ run : |
242+ python -m pip install --upgrade --upgrade-strategy eager pip pip-tools
243+ pip-compile --all-extras -o requirements-dev.txt pyproject.toml
244+ pip install -r requirements-dev.txt
142245
143246 - name : Generate docs with sphinx
144247 run : |
0 commit comments