Skip to content

Commit 9ff7a43

Browse files
committed
actions: clang: use ccache
Use ccache to speed up builds. Signed-off-by: Anas Nashif <[email protected]>
1 parent be9d542 commit 9ff7a43

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/clang.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ jobs:
5757
${CLANG_ROOT_DIR}/bin/clang --version
5858
gcc --version
5959
ls -la
60+
- name: Prepare ccache timestamp/data
61+
id: ccache_cache_timestamp
62+
shell: cmake -P {0}
63+
run: |
64+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
65+
string(REPLACE "/" "_" repo ${{github.repository}})
66+
string(REPLACE "-" "_" repo2 ${repo})
67+
message("::set-output name=repo::${repo2}")
68+
- name: use cache
69+
id: cache-ccache
70+
uses: nashif/action-s3-cache@master
71+
with:
72+
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-clang-${{ matrix.platform }}-ccache
73+
path: /github/home/.ccache
74+
aws-s3-bucket: ccache.zephyrproject.org
75+
aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }}
76+
aws-secret-access-key: ${{ secrets.CCACHE_S3_SECRET_ACCESS_KEY }}
77+
aws-region: us-east-2
78+
79+
- name: ccache stats initial
80+
run: |
81+
test -d github/home/.ccache && mv github/home/.ccache /github/home/.ccache
82+
ccache -M 10G -s
6083
6184
- name: Run Tests with Twister
6285
id: twister
@@ -87,6 +110,10 @@ jobs:
87110
fi
88111
fi
89112
113+
- name: ccache stats post
114+
run: |
115+
ccache -s
116+
90117
- name: Upload Unit Test Results
91118
if: always() && steps.twister.outputs.report_needed != 0
92119
uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)