Show cloc diff with the previous commit

This commit is contained in:
Oleg Kalachev
2026-08-14 01:41:57 +03:00
parent 87ce9c20cb
commit 7308159b74
2 changed files with 13 additions and 2 deletions
+11 -2
View File
@@ -53,7 +53,16 @@ jobs:
- run: sudo apt-get install -y cloc jq
- name: Print source lines of code
run: cloc --by-file-by-lang flix
- name: Checkout previous revision
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
path: prev
- name: Annotate total source lines
run: |
sloc=$(cloc flix --json | jq -r '.SUM.code')
echo "::notice title=SLOC::Current SLOC = $sloc"
SLOC=$(cloc flix --json | jq -r '.SUM.code')
PREV_SLOC=$(cloc prev/flix --json | jq -r '.SUM.code')
DIFF=$(printf '%+d' "$((SLOC - PREV_SLOC))")
echo "* Current SLOC: $SLOC" >> $GITHUB_STEP_SUMMARY
echo "* Previous SLOC: $PREV_SLOC" >> $GITHUB_STEP_SUMMARY
echo "* Diff: $DIFF" >> $GITHUB_STEP_SUMMARY
+2
View File
@@ -8,6 +8,8 @@
void setDefaults() {
// Set defaults here
int __x = 0;
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
pwmFrequency = 38000;
#endif