File tree 2 files changed +50
-0
lines changed
2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -124,3 +124,13 @@ jobs:
124
124
with :
125
125
name : drc-results
126
126
path : sg13g2_tt_top.lyrdb
127
+
128
+ - name : install xmllint
129
+ run : |
130
+ sudo apt-get update
131
+ sudo apt-get install -y libxml2-utils
132
+
133
+ - name : DRC summary
134
+ if : always()
135
+ run : |
136
+ scripts/drc-summary.sh sg13g2_tt_top.lyrdb >> $GITHUB_STEP_SUMMARY
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ DRC_FILE=$1
4
+
5
+ if [ -z " $DRC_FILE " ]; then
6
+ echo " Usage: $0 <filename.lyrdb>"
7
+ exit 1
8
+ fi
9
+
10
+ if [ ! -f " $DRC_FILE " ]; then
11
+ echo " DRC file not found: $DRC_FILE "
12
+ exit 1
13
+ fi
14
+
15
+ DRC_COUNT=$( xmllint --xpath ' count(//item)' $DRC_FILE )
16
+
17
+ if [ " $DRC_COUNT " -eq 0 ]; then
18
+ echo " ## DRC clean"
19
+ echo " "
20
+ echo " No DRC issues found"
21
+ exit 0
22
+ fi
23
+
24
+ CATEGORIES=$( xmllint --xpath ' /report-database/categories' $DRC_FILE )
25
+
26
+ function category_description() {
27
+ local category=$1
28
+ echo $CATEGORIES | xmllint --xpath " //category[name/text()='$category ']/description/text()" - | cut -d " " -f 2-
29
+ }
30
+
31
+ echo " ## DRC issues found: $DRC_COUNT "
32
+ echo " "
33
+ echo " | Category | Count | Description |"
34
+ echo " | --- | --- | --- |"
35
+ xmllint --xpath ' //item/category/text()' $DRC_FILE | tr ' ' ' \n' | sort | uniq -c | (
36
+ while read count category; do
37
+ category=$( echo $category | sed -E " s/^'|'\$ //g" )
38
+ echo " | $category | $count | $( category_description $category ) |"
39
+ done
40
+ )
You can’t perform that action at this time.
0 commit comments