Skip to content

Commit 5977fb6

Browse files
added github workflow
1 parent 1ec7541 commit 5977fb6

File tree

5 files changed

+47
-11
lines changed

5 files changed

+47
-11
lines changed

.github/workflows/checks.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,24 @@ jobs:
120120
path: .security.json
121121
include-hidden-files: true
122122

123+
Vulnerabilities:
124+
name: Package Vulnerabilities Checks (Python-${{ matrix.python-version }})
125+
runs-on: ubuntu-latest
126+
strategy:
127+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
128+
129+
steps:
130+
- name: SCM Checkout
131+
uses: actions/checkout@v4
132+
133+
- name: Setup Python & Poetry Environment
134+
uses: ./.github/actions/python-environment
135+
with:
136+
python-version: ${{ matrix.python-version }}
137+
138+
- name: Run Package vulnerabilities Check
139+
run: poetry run nox -s dependency:audit
140+
123141
Format:
124142
name: Format Check
125143
runs-on: ubuntu-latest

exasol/toolbox/nox/_dependencies.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,20 @@ def _normalize_package_name(name: str) -> str:
212212
return template.format(heading=heading(), rows=rows)
213213

214214

215+
def _audit(session: Session) -> None:
216+
session.run("poetry", "run", "pip-audit")
217+
218+
215219
@nox.session(name="dependency:licenses", python=False)
216220
def dependency_licenses(session: Session) -> None:
217221
"""returns the packages and their licenses"""
218222
toml = Path("pyproject.toml")
219223
dependencies = _dependencies(toml.read_text())
220224
package_infos = _licenses()
221225
print(_packages_to_markdown(dependencies=dependencies, packages=package_infos))
226+
227+
228+
@nox.session(name="dependency:audit", python=False)
229+
def audit(session: Session) -> None:
230+
"""Runs the audit for packages regard known vulnerabilities"""
231+
_audit(session)

exasol/toolbox/nox/_lint.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ def report_illegal(illegal: dict[str, list[str]], console: rich.console.Console)
130130
console.print("")
131131

132132

133-
def _audit(session: Session) -> None:
134-
session.run("poetry", "run", "pip-audit")
135-
136-
137133
@nox.session(name="lint:code", python=False)
138134
def lint(session: Session) -> None:
139135
"Runs the static code analyzer on the project"
@@ -195,9 +191,3 @@ def import_lint(session: Session) -> None:
195191
"Please make sure you have a configuration file for the importlinter"
196192
)
197193
_import_lint(session=session, path=path)
198-
199-
200-
@nox.session(name="project:audit", python=False)
201-
def audit(session: Session) -> None:
202-
"""Runs the audit for packages regard known vulnerabilities"""
203-
_audit(session)

exasol/toolbox/nox/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def check(session: Session) -> None:
5353
_type_check,
5454
lint,
5555
type_check,
56-
audit
5756
)
5857
from exasol.toolbox.nox._documentation import (
5958
build_docs,
@@ -82,6 +81,7 @@ def check(session: Session) -> None:
8281

8382
from exasol.toolbox.nox._dependencies import (
8483
dependency_licenses,
84+
audit
8585
)
8686

8787
# isort: on

exasol/toolbox/templates/github/workflows/checks.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,24 @@ jobs:
126126
path: .security.json
127127
include-hidden-files: true
128128

129+
Vulnerabilities:
130+
name: Package Vulnerabilities Checks (Python-${{ matrix.python-version }})
131+
runs-on: ubuntu-latest
132+
strategy:
133+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
134+
135+
steps:
136+
- name: SCM Checkout
137+
uses: actions/checkout@v4
138+
139+
- name: Setup Python & Poetry Environment
140+
uses: ./.github/actions/python-environment
141+
with:
142+
python-version: ${{ matrix.python-version }}
143+
144+
- name: Run Package vulnerabilities Check
145+
run: poetry run nox -s dependency:audit
146+
129147
Format:
130148
name: Format Check
131149
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)