Skip to content

Commit 5befdb1

Browse files
authored
Merge pull request #6 from Koen1999/deps
Updated dependencies
2 parents 8b4b02f + ec40cbf commit 5befdb1

11 files changed

Lines changed: 278 additions & 121 deletions

File tree

.github/workflows/python-pr.yml

Lines changed: 152 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,117 @@
11
name: Python PR
2-
2+
permissions:
3+
contents: read
34
on:
45
pull_request:
56
branches: ["master"]
67
push:
78
branches: ["master"]
89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
11+
cancel-in-progress: true
1112

1213

1314
jobs:
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: |

.github/workflows/python-push.yml

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,78 @@
11
name: Python Push
2-
2+
permissions:
3+
contents: read
34
on:
45
push:
56
branches: ["master"]
67
concurrency:
78
group: ${{ github.workflow }}-${{ github.ref }}
8-
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
9+
cancel-in-progress: true
910

1011
jobs:
11-
test:
12+
extensive-test:
1213
name: Extensive Test
13-
runs-on: self-hosted
14+
runs-on: ${{ matrix.os }}
1415

1516
strategy:
1617
fail-fast: true
1718
matrix:
18-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1921

2022
steps:
21-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v5
2224

2325
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2527
with:
2628
python-version: ${{ matrix.python-version }}
2729
cache: "pip"
2830

2931
- name: Install dependencies
3032
run: |
31-
python -m pip install --upgrade pip setuptools wheel build
32-
pip install -r requirements.txt
33+
python -m pip install --upgrade --upgrade-strategy eager pip pip-tools suricata-check[performance]
34+
pip-compile --extra test --extra ml -o requirements-ml.txt pyproject.toml
35+
pip install -r requirements-ml.txt
3336
3437
- name: Test with pytest - Fast
3538
run: |
3639
pytest -m "not slow"
3740
41+
integration-test:
42+
name: Integration Test
43+
runs-on: self-hosted
44+
needs:
45+
- extensive-test
46+
47+
strategy:
48+
fail-fast: true
49+
matrix:
50+
os: [ubuntu-latest]
51+
python-version: ["3.10", "3.14"]
52+
53+
steps:
54+
- uses: actions/checkout@v5
55+
56+
- name: Set up Python ${{ matrix.python-version }}
57+
uses: actions/setup-python@v6
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
cache: "pip"
61+
62+
- name: Install dependencies
63+
run: |
64+
python -m pip install --upgrade --upgrade-strategy eager pip pip-tools suricata-check[performance]
65+
pip-compile --extra test --extra ml -o requirements-ml.txt pyproject.toml
66+
pip install -r requirements-ml.txt
67+
3868
- name: Test with pytest - Integration ET OPEN v7
3969
run: |
4070
pytest -k et_open -k v7 -m "slow" --cov-fail-under=0
71+
72+
- name: Test with pytest - Integration ET OPEN v5
73+
run: |
74+
pytest -k et_open -k v5 -m "slow" --cov-fail-under=0
75+
76+
- name: Test with pytest - Integration Snort Community
77+
run: |
78+
pytest -k snort_community -m "slow" --cov-fail-under=0

0 commit comments

Comments
 (0)