Skip to content

Commit

Permalink
Updated code_scan workflow to use tox (#924)
Browse files Browse the repository at this point in the history
<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary

<!--
Resolves #111 and #222.
Depends on #1000 (for series of dependent commits).

This PR introduces this capability to make the project better in this
and that.

- Added this feature
- Removed that feature
- Fixed the problem #1234
-->

### How to test
<!-- Describe the testing procedure for reviewers, if changes are
not fully covered by unit tests or manual testing can be complicated.
-->

### Checklist
<!-- Put an 'x' in all the boxes that apply -->
- [ ] I have added unit tests to cover my changes.​
- [ ] I have added integration tests to cover my changes.​
- [ ] I have added the description of my changes into
[CHANGELOG](https://github.com/openvinotoolkit/datumaro/blob/develop/CHANGELOG.md).​
- [ ] I have updated the
[documentation](https://github.com/openvinotoolkit/datumaro/tree/develop/docs)
accordingly

### License

- [ ] I submit _my code changes_ under the same [MIT
License](https://github.com/openvinotoolkit/datumaro/blob/develop/LICENSE)
that covers the project.
  Feel free to contact the maintainers if that's a concern.
- [ ] I have updated the license header for each file (see an example
below).

```python
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
```
  • Loading branch information
yunchu authored Apr 10, 2023
1 parent b79dd4b commit c425353
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/code_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Run checks
run: |
pip install --user -r tests/requirements-linters.txt
echo "Bandit version: "`bandit --version | head -1`
bandit -r -c ipas_default.config ./ -f txt -o bandit-report.txt
- name: Bandit Scanning
run: run: tox -e bandit-scan
- name: Upload Bandit artifact
uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[tox]
isolated_build = true
skip_missing_interpreters = true
envlist =
pre-commit


[testenv:pre-commit]
basepython = python3
deps =
pre-commit
commands = pre-commit run --show-diff-on-failure --color=always --all-files


[testenv:bandit-scan]
deps =
bandit
commands =
- bandit -r -c ipas_default.config ./ -f txt -o {toxworkdir}/bandit-report.txt

0 comments on commit c425353

Please sign in to comment.