Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 15 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
name: CI / build

on:
push:
branches: [ main ]
pull_request:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: build (${{ matrix.python-version }})
name: build (${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.11", "3.12" ]
python: ["3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python }}

- name: Upgrade pip
run: python -m pip install --upgrade pip
Expand All @@ -35,7 +29,7 @@ jobs:
run: pip install poetry

- name: Install dependencies
run: poetry install --no-interaction
run: poetry install --with dev --no-interaction

- name: Ruff
run: poetry run ruff check .
Expand All @@ -44,23 +38,22 @@ jobs:
run: poetry run black --check .

- name: Pytest
env:
PYTHONPATH: src
run: poetry run pytest -q
run: PYTHONPATH=src poetry run pytest -q

- name: Mypy
run: poetry run mypy src

- name: Package & smoke-test CLI
- name: Generate sample report
run: |
poetry build
poetry run python -m pip install .
mkdir -p _intel
diff-risk examples/sample_apv.json -f md -o _intel/report.md
mkdir -p examples
[[ -f examples/sample_apv.json ]] || printf '{"findings":[]}\n' > examples/sample_apv.json
poetry run diff-risk examples/sample_apv.json -f md -o report.md

- name: Upload sample report
if: always()
uses: actions/upload-artifact@v4
with:
name: sample-report
path: _intel/report.md
path: |
report.md
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rich = "^13"

[tool.poetry.group.dev.dependencies]
pytest = "^8"
ruff = "^0.6"
ruff = "0.6.9"
black = "^24.8"
mypy = "^1.11"

Expand Down
Empty file added pyproject.toml.__fixed
Empty file.
5 changes: 5 additions & 0 deletions report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Diff Risk Dashboard 🟢 — No findings

> ✅ No findings detected (all severities are 0).

> Generated by diff-risk-dashboard CLI
2 changes: 1 addition & 1 deletion src/diff_risk_dashboard/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def bar(n: int) -> str:
w = max(1, round(n / maxc * bar_w))
return "█" * w

title = Text.assemble(
title = Text.assemble( # type: ignore[arg-type]
("Diff Risk Dashboard ", "bold"),
(emoji + " ",),
("— Worst: ", "dim"),
Expand Down
Loading