From f3e25d3d26217f802bf42ec843a0a0eb62d93005 Mon Sep 17 00:00:00 2001 From: Sean T Allen Date: Tue, 8 Aug 2023 09:02:35 -0400 Subject: [PATCH] Save libs/LLVM cache immediately after building it (#4379) Prior to this change, if a subsequent job after we built the libs/LLVM cache failed then the LLVM that we spent a ton of time building would not be saved and the process would have to be repeated again. --- .github/workflows/nightlies.yml | 14 ++++++++++---- .github/workflows/pr.yml | 14 ++++++++++---- .github/workflows/release.yml | 14 ++++++++++---- .github/workflows/stress-test-runtime.yml | 14 ++++++++++---- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml index 9befc7d24a..b6b95e237f 100644 --- a/.github/workflows/nightlies.yml +++ b/.github/workflows/nightlies.yml @@ -29,15 +29,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Cache Libs - id: cache-libs - uses: actions/cache@v3 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v3 with: path: build/libs key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Build Libs - if: steps.cache-libs.outputs.cache-hit != 'true' + if: steps.restore-libs.outputs.cache-hit != 'true' run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Nightly run: bash .ci-scripts/x86-64-nightly.bash env: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5acf5c7662..5986b275c9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -93,15 +93,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Cache Libs - id: cache-libs - uses: actions/cache@v3 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v3 with: path: build/libs key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Build Libs - if: steps.cache-libs.outputs.cache-hit != 'true' + if: steps.restore-libs.outputs.cache-hit != 'true' run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Configure Debug Runtime run: make configure arch=x86-64 config=debug - name: Build Debug Runtime diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ce20a9a89..2f9617292a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,15 +52,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Cache Libs - id: cache-libs - uses: actions/cache@v3 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v3 with: path: build/libs key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Build Libs - if: steps.cache-libs.outputs.cache-hit != 'true' + if: steps.restore-libs.outputs.cache-hit != 'true' run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Release run: bash .ci-scripts/x86-64-release.bash env: diff --git a/.github/workflows/stress-test-runtime.yml b/.github/workflows/stress-test-runtime.yml index 383751e465..22870fa848 100644 --- a/.github/workflows/stress-test-runtime.yml +++ b/.github/workflows/stress-test-runtime.yml @@ -33,15 +33,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Cache Libs - id: cache-libs - uses: actions/cache@v3 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v3 with: path: build/libs key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Build Libs - if: steps.cache-libs.outputs.cache-hit != 'true' + if: steps.restore-libs.outputs.cache-hit != 'true' run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} - name: Configure Debug Runtime run: make configure config=debug - name: Build Debug Runtime