Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cba668088 |
@@ -6,9 +6,21 @@ on:
|
||||
python_version:
|
||||
type: string
|
||||
default: "3.14"
|
||||
source_path:
|
||||
type: string
|
||||
default: "app"
|
||||
tests_path:
|
||||
type: string
|
||||
default: "tests"
|
||||
test_command:
|
||||
type: string
|
||||
default: "coverage run -m pytest"
|
||||
coverage_fail_under:
|
||||
type: string
|
||||
default: "60"
|
||||
run_security_scan:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
@@ -26,24 +38,25 @@ jobs:
|
||||
- name: Install Tools & Deps
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
pip install -e .[dev] || pip install -e .[test] || pip install -e .
|
||||
pip install -e ".[dev]" || pip install -e ".[test]" || pip install -e .
|
||||
pip install ruff coverage pip-audit bandit
|
||||
|
||||
- name: Linting
|
||||
run: ruff check app tests
|
||||
run: ruff check ${{ inputs.source_path }} ${{ inputs.tests_path }}
|
||||
|
||||
- name: Tests
|
||||
run: |
|
||||
${{ inputs.test_command }}
|
||||
coverage report --fail-under=60
|
||||
coverage report --fail-under=${{ inputs.coverage_fail_under }}
|
||||
coverage xml
|
||||
coverage html
|
||||
|
||||
- name: Security Scan
|
||||
if: ${{ inputs.run_security_scan }}
|
||||
run: |
|
||||
pip freeze | grep -v "git+" > req.txt
|
||||
pip-audit -r req.txt
|
||||
bandit -r app/
|
||||
bandit -r ${{ inputs.source_path }}
|
||||
|
||||
- name: Upload Coverage HTML
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user