Skip to content

Commit

Permalink
GHA: switch stats step summaries to table format.
Browse files Browse the repository at this point in the history
  • Loading branch information
kanaka committed Mar 19, 2024
1 parent 4780047 commit 0601595
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ jobs:
- name: Generate stats
run: |
make stats # Build compressed artifacts
echo "### JavaScript stats" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
make stats^js >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo -e "| Lines | Bytes | File |\n| ----- | ----- | ---- |"
make stats^js | awk '/ *[0-9]+/ {print "| "$1" | "$2" | "$3" | "}' >> $GITHUB_STEP_SUMMARY
echo "### Python stats" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
make stats^python >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo -e "| Lines | Bytes | File |\n| ----- | ----- | ---- |"
make stats^python | awk '/ *[0-9]+/ {print "| "$1" | "$2" | "$3" | "}' >> $GITHUB_STEP_SUMMARY
echo "### ClojureScript stats" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
make stats^cljs >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
make stats^cljs | awk '/ *[0-9]+/ {print "| "$1" | "$2" | "$3" | "}' >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions cljs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ miniMAL.js: node_modules/shadow-cljs src/miniMAL/stepA_miniMAL.cljc
# Stats
#
stats^%: src/miniMAL/%.cljc src-min/miniMAL/%.cljc
@wc $^ | grep -v "total"
@wc -l -c $^ | grep -v "total"


.PHONY: clean stats

stats: $(foreach s,$(STEPS),stats^$(s)) miniMAL core.json
@wc miniMAL core.json | grep -v "total"
@wc -l -c miniMAL core.json | grep -v "total"

clean:
rm -f $(MIN_FILES)
Expand Down
8 changes: 4 additions & 4 deletions js/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ regpack^%: %-regpack.js
# Stats
#
stats^%: %.js %-regpack.js
@wc $^ | grep -v "total"
@wc -l -c $^ | grep -v "total"

stats-full^%: %.js %-uglify.js %-regpack.js
@wc $^ | grep -v "total"
@wc -l -c $^ | grep -v "total"

#
# Web
Expand Down Expand Up @@ -94,9 +94,9 @@ miniMAL-core.js: core.json
.PHONY: regpack stats stats-full clean
regpack: $(foreach s,$(STEPS),regpack^$(s))
stats: $(foreach s,$(STEPS),stats^$(s)) core.json $(NODE_FILES) $(WEB_FILES)
@wc core.json $(NODE_FILES) $(WEB_FILES) | grep -v "total"
@wc -l -c core.json $(NODE_FILES) $(WEB_FILES) | grep -v "total"
stats-full: $(foreach s,$(STEPS),stats-full^$(s)) core.json $(NODE_FILES) $(WEB_FILES)
@wc core.json $(NODE_FILES) $(WEB_FILES) | grep -v "total"
@wc -l -c core.json $(NODE_FILES) $(WEB_FILES) | grep -v "total"

clean:
rm -f *-uglify.js *-uglify-pretty.js *-regpack.js miniMAL-js1k.b64 $(NODE_FILES) $(WEB_FILES)
8 changes: 4 additions & 4 deletions python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ minipy^%: %-minipy.py
# Stats
#
stats^%: %.py %-minipy.py
@wc $^ | grep -v "total"
@wc -l -c $^ | grep -v "total"

stats-full^%: %.py %-minipy.py %.pyz
@wc $^ | grep -v "total"
@wc -l -c $^ | grep -v "total"

.PHONY: minipy stats clean
minipy: $(foreach s,$(STEPS),minipy^$(s))
stats: $(foreach s,$(STEPS),stats^$(s)) core.json $(MIN_FILES)
@wc core.json $(MIN_FILES) | grep -v "total"
@wc -l -c core.json $(MIN_FILES) | grep -v "total"
stats-full: $(foreach s,$(STEPS),stats-full^$(s)) core.json $(MIN_FILES)
@wc core.json $(MIN_FILES) | grep -v "total"
@wc -l -c core.json $(MIN_FILES) | grep -v "total"


clean:
Expand Down

0 comments on commit 0601595

Please sign in to comment.