Skip to content

Commit

Permalink
chore: Modify GitHub actions workflow and add dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
georgedouzas committed Oct 26, 2024
1 parent 3e883b0 commit 8aa7f97
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,9 @@ jobs:
- name: Check code quality
run: pdm checks quality

- name: Check type annotations
run: pdm checks types

- name: Check vulnerabilities in dependencies
uses: pyupio/safety-action@v1
with:
api-key: ${{ secrets.SAFETY_API_KEY }}
env:
SAFETY_API_KEY: ${{ secrets.SAFETY_API_KEY }}
run: pdm checks dependencies

tests:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ jobs:
run: pdm checks types

- name: Check vulnerabilities in dependencies
uses: pyupio/safety-action@v1
with:
api-key: ${{ secrets.SAFETY_API_KEY }}
env:
SAFETY_API_KEY: ${{ secrets.SAFETY_API_KEY }}
run: pdm checks dependencies

tests:
Expand Down
6 changes: 5 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ def checks(session: nox.Session, file: str) -> None:
requirements_path,
]
session.run(*(args + dict(requirements_types)[file]), external=True)
session.run('safety', 'scan', '-r', requirements_path)
if os.environ.get('CI') is not None:
api_key = os.environ.get('SAFETY_API_KEY')
session.run('safety', '--key', api_key, '--stage', 'cicd', 'scan', '-r', requirements_path)
else:
session.run('safety', 'scan', '-r', requirements_path)


@nox.session(python=PYTHON_VERSIONS)
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ docs = [
"markdown-callouts>=0.4.0",
"markdown-exec>=1.9.3",
'pandas>=2.2.2',
"matplotlib>=3.9.2",
]
formatting = [
"black>=24.4.2",
Expand All @@ -88,6 +89,7 @@ checks = [
"mypy>=1.10.1",
"types-markdown>=3.6.0.20240316",
"types-toml>=0.10.8.20240310",
"numpy>=2.1.2",
]
tests = [
"pytest>=8.2.2",
Expand Down

0 comments on commit 8aa7f97

Please sign in to comment.