@@ -38,10 +38,10 @@ jobs:
3838
3939 steps :
4040 - name : Checkout
41- uses : actions/checkout@v4
41+ uses : actions/checkout@v5
4242
4343 - name : Install uv
44- uses : astral-sh/setup-uv@v4
44+ uses : astral-sh/setup-uv@v7
4545 with :
4646 enable-cache : true
4747
@@ -66,52 +66,39 @@ jobs:
6666 shell : bash
6767 run : |
6868 set -euo pipefail
69- if grep -R --line-number -E " \beval\(|\bexec\(|pickle\.loads|yaml\.load(?!_safe) |subprocess\.(Popen|call)" src/ tests/ || true; then
69+ if grep -rn -E ' \beval\(|\bexec\(|pickle\.loads|yaml\.load\( |subprocess\.(Popen|call)\(' src/ tests/ 2>/dev/null | grep -v 'yaml\.load_safe' || true; then
7070 echo "⚠️ Potentially dangerous API usage detected. Please review." >&2
7171 exit 2
7272 fi
7373
7474 - name : Upload coverage.xml
75- uses : actions/upload-artifact@v4
75+ uses : actions/upload-artifact@v5
7676 with :
7777 name : coverage-${{ matrix.python-version }}
7878 path : coverage.xml
7979
8080 - name : Upload coverage HTML
81- uses : actions/upload-artifact@v4
81+ uses : actions/upload-artifact@v5
8282 with :
8383 name : coverage-html-${{ matrix.python-version }}
8484 path : htmlcov
8585
86- # Upload Codecov once to avoid noisy duplicate uploads
87- - name : Upload to Codecov
88- if : matrix.python-version == '3.11'
89- uses : codecov/codecov-action@v4
90- with :
91- files : coverage.xml
92- flags : unittests
93- fail_ci_if_error : false
94- env :
95- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
96-
9786 security :
98- name : Security Scan (Bandit + Safety )
87+ name : Security Scan (Bandit)
9988 runs-on : ubuntu-latest
10089 needs : test
101- # Grant code scanning upload only here
10290 permissions :
10391 contents : read
104- security-events : write
10592
10693 env :
10794 SECURITY_FAIL_LEVEL : MEDIUM
10895
10996 steps :
11097 - name : Checkout
111- uses : actions/checkout@v4
98+ uses : actions/checkout@v5
11299
113100 - name : Install uv
114- uses : astral-sh/setup-uv@v4
101+ uses : astral-sh/setup-uv@v7
115102 with :
116103 enable-cache : true
117104
@@ -121,33 +108,57 @@ jobs:
121108 - name : Sync dependencies
122109 run : uv sync --all-extras --dev
123110
124- - name : Run Bandit (JSON + SARIF )
111+ - name : Run Bandit (JSON)
125112 run : |
126- uv run bandit -r src/ -f json -o bandit-report.json || true
127- uv run bandit -r src/ -f sarif -o bandit-report.sarif || true
128-
129- - name : Upload Bandit SARIF to GitHub Code Scanning
130- uses : github/codeql-action/upload-sarif@v3
131- with :
132- sarif_file : bandit-report.sarif
133- continue-on-error : true
134-
135- - name : Run Safety (JSON)
136- run : uv run safety check --json > safety-report.json || true
113+ uv run bandit -r src/ -f json -o bandit-report.json || true
114+ uv run bandit -r src/ -f txt
137115
138116 - name : Apply Bandit threshold
139117 run : uv run python scripts/security_bandit_check.py
140118 continue-on-error : true
141119
142- - name : Fail on Safety vulnerabilities
143- run : uv run python scripts/security_safety_check.py
144-
145120 - name : Upload security reports
146121 if : always()
147- uses : actions/upload-artifact@v4
122+ uses : actions/upload-artifact@v5
148123 with :
149124 name : security-reports
150- path : |
151- bandit-report.json
152- bandit-report.sarif
153- safety-report.json
125+ path : bandit-report.json
126+
127+ docs :
128+ name : Build Documentation
129+ runs-on : ubuntu-latest
130+ needs : test
131+ permissions :
132+ contents : write # Needed for GitHub Pages deployment
133+
134+ steps :
135+ - name : Checkout
136+ uses : actions/checkout@v5
137+
138+ - name : Install uv
139+ uses : astral-sh/setup-uv@v7
140+ with :
141+ enable-cache : true
142+
143+ - name : Set up Python
144+ run : uv python install 3.11
145+
146+ - name : Sync dependencies (includes sphinx)
147+ run : uv sync --all-extras --dev
148+
149+ - name : Build documentation
150+ run : uv run sphinx-build -b html docs docs/_build/html
151+
152+ - name : Upload documentation artifacts
153+ uses : actions/upload-artifact@v5
154+ with :
155+ name : documentation
156+ path : docs/_build/html
157+
158+ - name : Deploy to GitHub Pages
159+ if : github.ref == 'refs/heads/main' && github.event_name == 'push'
160+ uses : peaceiris/actions-gh-pages@v3
161+ with :
162+ github_token : ${{ secrets.GITHUB_TOKEN }}
163+ publish_dir : ./docs/_build/html
164+ keep_files : false
0 commit comments