Skip to content

Commit 76412c4

Browse files
committed
Check Moonfin channel-group changes for new analyzer warnings
Run the project's changed-line analyzer on the pinned PR commit using the existing pre-feature base. Keep the check isolated from the PR branch.
1 parent 6b2a626 commit 76412c4

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check Moonfin PR warnings
2+
3+
on:
4+
push:
5+
branches:
6+
- ci/moonfin-channel-groups-lint
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
changed-lines-analyzer:
13+
name: Analyze changes against pre-feature base
14+
runs-on: ubuntu-26.04
15+
timeout-minutes: 35
16+
steps:
17+
- name: Check out Moonfin PR
18+
uses: actions/checkout@v5
19+
with:
20+
repository: Roboatlas21/Moonfin-Core
21+
ref: f907c2c401099bcba39a3f4a7e55b814b624b719
22+
fetch-depth: 0
23+
persist-credentials: false
24+
25+
- name: Set up Flutter
26+
uses: subosito/flutter-action@v2
27+
with:
28+
flutter-version: '3.47.2'
29+
channel: stable
30+
31+
- name: Resolve app and package dependencies
32+
run: |
33+
set -euo pipefail
34+
flutter pub get
35+
packages="custom_tv_text_field_fork design rar_fork server_core server_emby server_jellyfin server_plex playback_plex server_silo playback_silo"
36+
for pkg in $packages; do
37+
(cd "packages/$pkg" && flutter pub get >/dev/null)
38+
done
39+
40+
- name: Analyze changed Dart lines
41+
run: |
42+
set -euo pipefail
43+
python3 scripts/ci/touched_lines_diagnostics.py 0b55bc616da9bdb98816ebf02c8ae66fb2327ec8 HEAD --out "$RUNNER_TEMP/analyzer-delta.json"
44+
python3 - <<'PY'
45+
import json, os, sys
46+
with open(os.path.join(os.environ["RUNNER_TEMP"], "analyzer-delta.json")) as f:
47+
data = json.load(f)
48+
problems = [x for x in data["items"] if x["severity"] in ("error", "warning")]
49+
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f:
50+
f.write("## Moonfin PR changed-line diagnostics\n\n")
51+
f.write(f"Total diagnostics: {data['count']}\n\n")
52+
f.write(f"Errors or warnings in reported diagnostics: {len(problems)}\n\n")
53+
for x in data["items"]:
54+
f.write(f"- {x['file']}:{x['line']} {x['severity']} {x['code']}: {x['message']}\n")
55+
if data["count"] > len(data["items"]):
56+
sys.exit("More findings than displayed; review full analyzer output")
57+
if problems:
58+
sys.exit("New analyzer warning/error on PR-changed lines")
59+
PY

0 commit comments

Comments
 (0)