mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-07 08:55:09 +00:00
ci: semgrep to prevent test regression
(cherry picked from commit be4496e4ab)
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: Linters
|
|
|
|
on:
|
|
pull_request: { }
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
|
|
linters:
|
|
name: linters
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.14
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.14'
|
|
cache: pip
|
|
|
|
- name: Install and Run Pre-commit
|
|
uses: pre-commit/action@v3.0.0
|
|
|
|
semgrep:
|
|
name: semgrep
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.14
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.14'
|
|
cache: pip
|
|
|
|
- name: Download Semgrep rules
|
|
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
|
|
|
|
- name: Download semgrep
|
|
run: pip install semgrep
|
|
|
|
- name: Run Semgrep rules
|
|
run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness
|
|
|
|
- name: Semgrep for Test Correctness
|
|
run: semgrep ci --include=**/test_*.py --config ./semgrep/test-correctness.yml
|