Merge pull request #265 from Wolfvin/fix/refresh-vuln-db-workflow-inv… #308
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CodeLens Quality Gate | |
| on: | |
| push: | |
| branches: [main, develop, 'feature/**'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| quality-gate: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install pyyaml | |
| - name: Initialize CodeLens | |
| run: | | |
| python3 scripts/codelens.py scan . | |
| - name: Scan codebase | |
| run: | | |
| python3 scripts/codelens.py scan . | |
| - name: Run quality gate | |
| run: | | |
| python3 scripts/codelens.py audit . --check dead-code,smell,complexity --severity high | |
| - name: Upload SARIF results | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: codelens-results.sarif | |
| category: codelens | |
| benchmark: | |
| runs-on: ubuntu-latest | |
| needs: quality-gate | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Run benchmarks | |
| run: | | |
| cd benchmarks && python run_benchmarks.py --quick | |
| - name: Check for regression | |
| run: | | |
| python3 benchmarks/check_regression.py --compare baseline | |
| continue-on-error: true |