Skip to content

Commit 196ff71

Browse files
authored
ci: add CodeQL SAST and pin pip dependencies with hashes (#10)
* ci: add CodeQL SAST workflow and pin pip dependencies with hashes * ci: use requirements.in for CI installs (requirements.txt is hashed pinned)
1 parent 13ec1a7 commit 196ff71

4 files changed

Lines changed: 1318 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
pip install -r requirements.txt
34+
pip install -r requirements.in
3535
pip install pytest pytest-cov flake8 black mypy
3636
pip install -e .
3737
@@ -94,7 +94,7 @@ jobs:
9494

9595
- name: Check dependencies with safety
9696
run: |
97-
pip install -r requirements.txt
97+
pip install -r requirements.in
9898
safety check --json
9999
continue-on-error: true
100100

.github/workflows/codeql.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CodeQL SAST
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '20 3 * * 1' # Every Monday at 03:20 UTC
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analyze:
15+
name: Analyze Python
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write
19+
actions: read
20+
contents: read
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
with:
26+
persist-credentials: false
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
30+
with:
31+
languages: python
32+
queries: security-extended
33+
34+
- name: Autobuild
35+
uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
39+
with:
40+
category: "/language:python"

requirements.in

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Core dependencies
2+
networkx>=3.0
3+
numpy>=1.24.0
4+
scipy>=1.10.0
5+
6+
# CLI
7+
click>=8.1.0
8+
9+
# Visualization
10+
matplotlib>=3.7.0
11+
pyvis>=0.3.2
12+
13+
# Testing
14+
pytest>=7.4.0
15+
pytest-cov>=4.1.0
16+
17+
# Data handling
18+
pandas>=2.0.0
19+
20+
# Development
21+
black>=23.0.0
22+
mypy>=1.0.0
23+
flake8>=6.0.0
24+
25+
# Security
26+
bandit>=1.7.0

0 commit comments

Comments
 (0)