Skip to content

Commit 71fbd0b

Browse files
authored
Update and rename test.yml to ci.yml
1 parent 0887cda commit 71fbd0b

1 file changed

Lines changed: 47 additions & 4 deletions

File tree

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
name: test
1+
name: CI
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
7+
schedule:
8+
# Weekly (Mon 06:00 UTC) so pip-audit catches newly disclosed CVEs even
9+
# without a code change.
10+
- cron: "0 6 * * 1"
711

812
jobs:
913
lint:
@@ -70,10 +74,27 @@ jobs:
7074
- name: Install dependencies
7175
run: |
7276
python -m pip install --upgrade pip
73-
pip install -e .
77+
pip install -e . "coverage[toml]>=7.0"
7478
75-
- name: Run tests
76-
run: python -m unittest discover -s tests -v
79+
- name: Run tests with coverage
80+
run: coverage run -m unittest discover -s tests -v
81+
82+
# `coverage report` enforces `fail_under` from pyproject.toml (90%),
83+
# so an insufficiently-tested change fails this job.
84+
- name: Coverage report (enforces fail_under)
85+
run: coverage report
86+
87+
- name: Coverage XML
88+
if: always()
89+
run: coverage xml
90+
91+
- name: Upload coverage report
92+
if: always()
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: coverage-${{ matrix.python-version }}
96+
path: coverage.xml
97+
if-no-files-found: ignore
7798

7899
package:
79100
name: Build wheel, install & CLI smoke test
@@ -128,3 +149,25 @@ jobs:
128149
with:
129150
name: dist
130151
path: dist/*
152+
153+
audit:
154+
name: pip-audit (dependency CVEs)
155+
runs-on: ubuntu-latest
156+
steps:
157+
- uses: actions/checkout@v4
158+
159+
- uses: actions/setup-python@v5
160+
with:
161+
python-version: "3.12"
162+
163+
- name: Install pip-audit
164+
run: |
165+
python -m pip install --upgrade pip
166+
pip install "pip-audit>=2.7"
167+
168+
# Audit the PROJECT's dependency closure resolved from pyproject.toml
169+
# (rich, httpx, prompt_toolkit + transitives) — NOT the whole runner
170+
# environment, which would flag unrelated tooling like pip/setuptools.
171+
# Record accepted/unfixable advisories with `--ignore-vuln <ID>`.
172+
- name: pip-audit
173+
run: pip-audit . --strict --progress-spinner=off

0 commit comments

Comments
 (0)