From cf6b1740a14634406bb3426309dd92af8faa06fb Mon Sep 17 00:00:00 2001 From: Quentin Boswank Date: Tue, 19 Sep 2023 19:43:10 +0200 Subject: Add more caching to the CI more specificaly to the tarballs download. The function CT_Fetch now touches the already existing files to be comparable to the not used ones that can araise when a package is updated. This comparsion is needed because if it would not exist the tarball would grow in size due to not used but still cached packages. This would take time but is definitly something to worry about. Signed-off-by: Quentin Boswank --- .github/workflows/build-toolchains.yml | 6 ++++-- .github/workflows/continuous-integration-workflow.yml | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build-toolchains.yml b/.github/workflows/build-toolchains.yml index b762bf59..064fea8c 100644 --- a/.github/workflows/build-toolchains.yml +++ b/.github/workflows/build-toolchains.yml @@ -55,10 +55,12 @@ jobs: run: | tar -xf ct-ng.tar - name: download tarballs - uses: actions/download-artifact@v3 + uses: actions/cache/restore@v3 with: - name: src.tar + path: src.tar + key: src.tar-${{ hashFiles('.local/share/crosstool-ng/packages') }}-${{ hashFiles('.local/share/crosstool-ng/samples') }} - name: extract tarballs + continue-on-error: true run: | tar -xvf src.tar - name: prereq Linux diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index dcb37031..7870eb53 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -61,6 +61,19 @@ jobs: - name: "extract ct-ng" run: | tar -xf ct-ng.tar + - name: cache tarballs + id: cache + uses: actions/cache@v3 + with: + path: src.tar + key: src.tar-${{ hashFiles('.local/share/crosstool-ng/packages') }}-${{ hashFiles('.local/share/crosstool-ng/samples') }} + restore-keys: | + src.tar-${{ hashFiles('.local/share/crosstool-ng/packages') }}- + src.tar- + - name: extract tarballs + run: | + tar -xvf src.tar || true + touch stamp - name: "prereq Linux" if: ${{ runner.os == 'Linux' }} run: | @@ -82,12 +95,8 @@ jobs: ct-ng olddefconfig; \ ct-ng source; \ done + find src -type f -not -newer stamp -delete -print tar -cvf src.tar src - - name: "upload sources" - uses: actions/upload-artifact@v3 - with: - name: src.tar - path: src.tar toolchains: needs: [crosstool, tarballs] -- cgit v1.2.3