aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Boswank <qubos@outlook.de>2023-09-19 19:43:10 +0200
committerChris Packham <judge.packham@gmail.com>2023-10-04 16:12:23 +1300
commitcf6b1740a14634406bb3426309dd92af8faa06fb (patch)
treeed0da4e06cb4d1051081a646aac9f2f6aa44d1df
parent591a04186547470ead163f955bc39ef9c87348c6 (diff)
downloadcrosstool-ng-cf6b1740a14634406bb3426309dd92af8faa06fb.tar.gz
crosstool-ng-cf6b1740a14634406bb3426309dd92af8faa06fb.tar.bz2
crosstool-ng-cf6b1740a14634406bb3426309dd92af8faa06fb.zip
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 <qubos@outlook.de>
-rw-r--r--.github/workflows/build-toolchains.yml6
-rw-r--r--.github/workflows/continuous-integration-workflow.yml19
-rw-r--r--scripts/functions1
3 files changed, 19 insertions, 7 deletions
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]
diff --git a/scripts/functions b/scripts/functions
index 94fd1e9e..841dce2c 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -956,6 +956,7 @@ CT_GetFile()
# Do we already have it in *our* tarballs dir?
if [ -r "${CT_TARBALLS_DIR}/${basename}${ext}" ]; then
CT_DoLog DEBUG "Already have '${CT_TARBALLS_DIR}/${basename}${ext}'"
+ touch "${CT_TARBALLS_DIR}/${basename}${ext}" # for CI
return 0
fi