Skip to content

Commit

Permalink
Add tox config; Run unit tests in pipeline using tox !ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
emilejq committed Dec 13, 2023
1 parent d342ae2 commit 0e1f835
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pip install -r requirements.txt
- name: Run unit tests
run: python -m pytest --junitxml results.xml
run: tox run -e py$version -- --junitxml results.xml

- name: Upload test results
uses: actions/upload-artifact@master
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ referencing==0.31.0
requests==2.31.0
rpds-py==0.13.1
sortedcontainers==2.4.0
tox==4.11.4
urllib3==2.0.7
25 changes: 25 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tox]
env_list = lint, sast, py{310, 311, 312}

[testenv]
description = Run unit tests with Pytest
skip_install = True
deps =
-r {tox_root}/requirements.txt
pytest
commands =
pytest --basetemp={env_tmp_dir} {posargs}

[testenv:lint]
description = Run lint scan with Ruff
deps =
ruff
commands =
ruff check .

[testenv:sast]
description = Run SAST scan with Bandit
deps =
ruff
commands =
ruff check ./cbom --select S

0 comments on commit 0e1f835

Please sign in to comment.