actions: clang: use ccache

Use ccache to speed up builds.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2021-11-16 10:07:52 -05:00
commit 5595e2a739

View file

@ -57,6 +57,29 @@ jobs:
${CLANG_ROOT_DIR}/bin/clang --version ${CLANG_ROOT_DIR}/bin/clang --version
gcc --version gcc --version
ls -la ls -la
- name: Prepare ccache timestamp/data
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
string(REPLACE "/" "_" repo ${{github.repository}})
string(REPLACE "-" "_" repo2 ${repo})
message("::set-output name=repo::${repo2}")
- name: use cache
id: cache-ccache
uses: nashif/action-s3-cache@master
with:
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-clang-${{ matrix.platform }}-ccache
path: /github/home/.ccache
aws-s3-bucket: ccache.zephyrproject.org
aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CCACHE_S3_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: ccache stats initial
run: |
test -d github/home/.ccache && mv github/home/.ccache /github/home/.ccache
ccache -M 10G -s
- name: Run Tests with Twister - name: Run Tests with Twister
id: twister id: twister
@ -87,6 +110,10 @@ jobs:
fi fi
fi fi
- name: ccache stats post
run: |
ccache -s
- name: Upload Unit Test Results - name: Upload Unit Test Results
if: always() && steps.twister.outputs.report_needed != 0 if: always() && steps.twister.outputs.report_needed != 0
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2