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