This code does not have any dependencies that are specific to any specific version of ubuntu. So instead of testing on a specific version and then needing to do work to keep the versions up-to-date, we switch to the ubuntu-latest target which should be sufficient for testing purposes. This work is being done as a part of https://github.com/openedx/platform-roadmap/issues/377 closes https://github.com/openedx/edx-platform/issues/35314
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# Finds code problems by structural pattern matching.
|
|
#
|
|
# New rules can be added to test_root/semgrep/ and they should be picked up
|
|
# automatically. See https://semgrep.dev/docs/ for documentation.
|
|
|
|
name: Semgrep code quality
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
run_semgrep:
|
|
name: Semgrep analysis
|
|
runs-on: "${{ matrix.os }}"
|
|
strategy:
|
|
matrix:
|
|
os: ["ubuntu-latest"]
|
|
python-version:
|
|
- "3.11"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "${{ matrix.python-version }}"
|
|
|
|
- name: Install semgrep
|
|
run: |
|
|
make pre-requirements
|
|
pip-sync requirements/edx/semgrep.txt
|
|
|
|
- name: Run semgrep
|
|
env:
|
|
# Peg this to some reasonable value so that semgrep's rewrapping
|
|
# of messages doesn't break up lines in an unpredictable manner:
|
|
# https://github.com/returntocorp/semgrep/issues/8608
|
|
COLUMNS: 80
|
|
run: |
|
|
semgrep scan --config test_root/semgrep/ --error --quiet \
|
|
-- lms cms common openedx
|