11name : CI / build
22
33on :
4- push :
5- branches : [ main ]
64 pull_request :
5+ push :
76 branches : [ main ]
87 workflow_dispatch :
98
10- permissions :
11- contents : read
12-
139jobs :
1410 build :
15- name : build (${{ matrix.python-version }})
11+ name : build (${{ matrix.python }})
1612 runs-on : ubuntu-latest
1713 strategy :
1814 fail-fast : false
1915 matrix :
20- python-version : [ "3.11", "3.12" ]
16+ python : ["3.11", "3.12"]
2117
2218 steps :
23- - name : Checkout
24- uses : actions/checkout@v4
19+ - uses : actions/checkout@v4
2520
26- - name : Setup Python
27- uses : actions/setup-python@v5
21+ - uses : actions/setup-python@v5
2822 with :
29- python-version : ${{ matrix.python-version }}
23+ python-version : ${{ matrix.python }}
3024
3125 - name : Upgrade pip
3226 run : python -m pip install --upgrade pip
3529 run : pip install poetry
3630
3731 - name : Install dependencies
38- run : poetry install --no-interaction -- with dev
32+ run : poetry install --with dev --no-interaction
3933
4034 - name : Ruff
4135 run : poetry run ruff check .
@@ -44,23 +38,22 @@ jobs:
4438 run : poetry run black --check .
4539
4640 - name : Pytest
47- env :
48- PYTHONPATH : src
49- run : poetry run pytest -q
41+ run : PYTHONPATH=src poetry run pytest -q
5042
5143 - name : Mypy
5244 run : poetry run mypy src
5345
54- - name : Package & smoke-test CLI
46+ - name : Generate sample report
5547 run : |
56- poetry build
57- poetry run python -m pip install .
58- mkdir -p _intel
59- diff-risk examples/sample_apv.json -f md -o _intel/report.md
48+ mkdir -p examples
49+ [[ -f examples/sample_apv.json ]] || printf '{"findings":[]}\n' > examples/sample_apv.json
50+ poetry run diff-risk examples/sample_apv.json -f md -o report.md
6051
6152 - name : Upload sample report
6253 if : always()
6354 uses : actions/upload-artifact@v4
6455 with :
6556 name : sample-report
66- path : _intel/report.md
57+ path : |
58+ report.md
59+ if-no-files-found : ignore
0 commit comments