Skip to content

Commit 97fa06f

Browse files
committed
ci: print ccache stats in job summary
1 parent 1988e17 commit 97fa06f

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'ccache statistics'
2+
description: 'Print job summary with selected ccache statistics'
3+
4+
inputs:
5+
name:
6+
description: 'Label to print in summary'
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Log ccache stats
13+
run: |
14+
CCACHE_OUTPUT=$(ccache -s)
15+
16+
CACHEABLE=$(echo "$CCACHE_OUTPUT" | grep "Cacheable calls" | awk '{print $3 " / " $5 " (" $6}')
17+
HITS=$(echo "$CCACHE_OUTPUT" | grep "Hits:" | head -1 | awk '{print $2 " / " $4 " (" $5}')
18+
UNCACHEABLE=$(echo "$CCACHE_OUTPUT" | grep "Uncacheable calls" | awk '{print $3 " / " $5 " (" $6}')
19+
ERRORS=$(echo "$CCACHE_OUTPUT" | grep "Errors:" | awk '{print $2 " / " $4 " (" $5}')
20+
21+
MD_TABLE_BUFF="## ccache statistics - ${{ inputs.name }} \n\n"
22+
MD_TABLE_BUFF+="| Metric | Value |\n"
23+
MD_TABLE_BUFF+="|--------|-------|\n"
24+
MD_TABLE_BUFF+="| Cacheable calls | $CACHEABLE |\n"
25+
MD_TABLE_BUFF+="| Hits | $HITS |\n"
26+
MD_TABLE_BUFF+="| Uncacheable calls | $UNCACHEABLE |\n"
27+
MD_TABLE_BUFF+="| Errors | $ERRORS |\n"
28+
29+
echo "$MD_TABLE_BUFF" >> $GITHUB_STEP_SUMMARY
30+
shell: bash

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ jobs:
174174
175175
# ==============
176176

177-
- name: Report ccache usage
178-
run: ccache -s
177+
- name: Log ccache stats
178+
uses: ./.github/actions/ccache-summary
179+
with:
180+
name: TesterIntegrated
179181

180182
ios-rnapp-appleapp:
181183
name: iOS road tests (RNApp & AppleApp)
@@ -246,5 +248,7 @@ jobs:
246248
247249
# ==============
248250

249-
- name: Report ccache usage
250-
run: ccache -s
251+
- name: Log ccache stats
252+
uses: ./.github/actions/ccache-summary
253+
with:
254+
name: RNApp & AppleApp

0 commit comments

Comments
 (0)