Skip to content

Commit

Permalink
Enable cache stash/restore in github action builds
Browse files Browse the repository at this point in the history
With ccache enabled, a cold build that used to take about 40 mins now takes
40 secs (the base case of 100% hit rate).

Before:

https://github.com/facebookexternal/nimble/actions/runs/8841486609/job/24278661118?pr=40

After:

https://github.com/facebookexternal/nimble/actions/runs/8841988087/job/24279928057?pr=40
  • Loading branch information
pedroerp committed Apr 26, 2024
1 parent 394d51c commit 462daf5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concurrency:
cancel-in-progress: true

jobs:
ubuntu-debug:
ubuntu-release:
runs-on: ubuntu-latest
if: ${{ github.repository == 'facebookexternal/nimble' }}
name: "Ubuntu Build"
Expand All @@ -40,6 +40,12 @@ jobs:
shell: bash
working-directory: nimble
steps:
- name: "Restore Build Cache"
uses: assignUser/stash/restore@v1
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-ubuntu-release-default

- name: "Checkout"
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -73,7 +79,13 @@ jobs:
$CXX --version
make
- name: "Post Build"
- name: "Cache Stats"
run: |
# Print and zero cache stats.
ccache -szv
- name: "Stash Build Cache"
uses: assignUser/stash/save@v1
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-ubuntu-release-default

0 comments on commit 462daf5

Please sign in to comment.