From d56eb16f52d6c4817474e6f6a568abf1c97668d5 Mon Sep 17 00:00:00 2001 From: Dimitri Huisman Date: Sat, 20 Aug 2022 08:43:27 +0000 Subject: [PATCH 1/3] Hotfix for workflow. For build step do not build from cache. Make sure cache layers are unique by using ${{ github.ref }} --- .github/workflows/build_test_deploy.yml | 59 ++++++++++++------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 7a042eee..6a22e69c 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -134,8 +134,7 @@ jobs: load: false push: false set: | - *.cache-from=type=gha,scope=build-${{ matrix.target }} - *.cache-to=type=gha,scope=build-${{ matrix.target }},mode=min + *.cache-to=type=gha,scope=build-${{ matrix.target }}-${{ github.ref }},mode=min *.platform=${{ inputs.architecture }} # This job runs all the tests. @@ -190,20 +189,20 @@ jobs: load: true push: false set: | - *.cache-from=type=gha,scope=build-docs - *.cache-from=type=gha,scope=build-setup - *.cache-from=type=gha,scope=build-admin - *.cache-from=type=gha,scope=build-antispam - *.cache-from=type=gha,scope=build-front - *.cache-from=type=gha,scope=build-imap - *.cache-from=type=gha,scope=build-smtp - *.cache-from=type=gha,scope=build-snappymail - *.cache-from=type=gha,scope=build-roundcube - *.cache-from=type=gha,scope=build-antivirus - *.cache-from=type=gha,scope=build-fetchmail - *.cache-from=type=gha,scope=build-resolver - *.cache-from=type=gha,scope=build-traefik-certdumper - *.cache-from=type=gha,scope=build-webdav + *.cache-from=type=gha,scope=build-docs-${{ github.ref }} + *.cache-from=type=gha,scope=build-setup-${{ github.ref }} + *.cache-from=type=gha,scope=build-admin-${{ github.ref }} + *.cache-from=type=gha,scope=build-antispam-${{ github.ref }} + *.cache-from=type=gha,scope=build-front-${{ github.ref }} + *.cache-from=type=gha,scope=build-imap-${{ github.ref }} + *.cache-from=type=gha,scope=build-smtp-${{ github.ref }} + *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }} + *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }} + *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }} + *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }} + *.cache-from=type=gha,scope=build-resolver-${{ github.ref }} + *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }} + *.cache-from=type=gha,scope=build-webdav-${{ github.ref }} *.platform=${{ inputs.architecture }} - name: Install python packages run: python3 -m pip install -r tests/requirements.txt @@ -255,20 +254,20 @@ jobs: files: ${{env.HCL_FILE}} push: true set: | - *.cache-from=type=gha,scope=build-docs - *.cache-from=type=gha,scope=build-setup - *.cache-from=type=gha,scope=build-admin - *.cache-from=type=gha,scope=build-antispam - *.cache-from=type=gha,scope=build-front - *.cache-from=type=gha,scope=build-imap - *.cache-from=type=gha,scope=build-smtp - *.cache-from=type=gha,scope=build-snappymail - *.cache-from=type=gha,scope=build-roundcube - *.cache-from=type=gha,scope=build-antivirus - *.cache-from=type=gha,scope=build-fetchmail - *.cache-from=type=gha,scope=build-resolver - *.cache-from=type=gha,scope=build-traefik-certdumper - *.cache-from=type=gha,scope=build-webdav + *.cache-from=type=gha,scope=build-docs-${{ github.ref }} + *.cache-from=type=gha,scope=build-setup-${{ github.ref }} + *.cache-from=type=gha,scope=build-admin-${{ github.ref }} + *.cache-from=type=gha,scope=build-antispam-${{ github.ref }} + *.cache-from=type=gha,scope=build-front-${{ github.ref }} + *.cache-from=type=gha,scope=build-imap-${{ github.ref }} + *.cache-from=type=gha,scope=build-smtp-${{ github.ref }} + *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }} + *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }} + *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }} + *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }} + *.cache-from=type=gha,scope=build-resolver-${{ github.ref }} + *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }} + *.cache-from=type=gha,scope=build-webdav-${{ github.ref }} *.platform=${{ inputs.architecture }} deploy-arm: From f35d82b3a0fd78863c599e99a699b411a0eb76f3 Mon Sep 17 00:00:00 2001 From: Dimitri Huisman Date: Sat, 20 Aug 2022 08:51:56 +0000 Subject: [PATCH 2/3] Also ${{ github.run_id }} for cache key. This makes rue that the cache key is unique across workflow runs --- .github/workflows/build_test_deploy.yml | 86 ++++++++++++------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 6a22e69c..dbf80bd3 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -134,7 +134,7 @@ jobs: load: false push: false set: | - *.cache-to=type=gha,scope=build-${{ matrix.target }}-${{ github.ref }},mode=min + *.cache-to=type=gha,scope=build-${{ matrix.target }}-${{ github.ref }}-${{ github.run_id }},mode=min *.platform=${{ inputs.architecture }} # This job runs all the tests. @@ -189,20 +189,20 @@ jobs: load: true push: false set: | - *.cache-from=type=gha,scope=build-docs-${{ github.ref }} - *.cache-from=type=gha,scope=build-setup-${{ github.ref }} - *.cache-from=type=gha,scope=build-admin-${{ github.ref }} - *.cache-from=type=gha,scope=build-antispam-${{ github.ref }} - *.cache-from=type=gha,scope=build-front-${{ github.ref }} - *.cache-from=type=gha,scope=build-imap-${{ github.ref }} - *.cache-from=type=gha,scope=build-smtp-${{ github.ref }} - *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }} - *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }} - *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }} - *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }} - *.cache-from=type=gha,scope=build-resolver-${{ github.ref }} - *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }} - *.cache-from=type=gha,scope=build-webdav-${{ github.ref }} + *.cache-from=type=gha,scope=build-docs-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-setup-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-admin-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-antispam-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-front-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-imap-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-smtp-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-resolver-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-webdav-${{ github.ref }}-${{ github.run_id }} *.platform=${{ inputs.architecture }} - name: Install python packages run: python3 -m pip install -r tests/requirements.txt @@ -254,20 +254,20 @@ jobs: files: ${{env.HCL_FILE}} push: true set: | - *.cache-from=type=gha,scope=build-docs-${{ github.ref }} - *.cache-from=type=gha,scope=build-setup-${{ github.ref }} - *.cache-from=type=gha,scope=build-admin-${{ github.ref }} - *.cache-from=type=gha,scope=build-antispam-${{ github.ref }} - *.cache-from=type=gha,scope=build-front-${{ github.ref }} - *.cache-from=type=gha,scope=build-imap-${{ github.ref }} - *.cache-from=type=gha,scope=build-smtp-${{ github.ref }} - *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }} - *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }} - *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }} - *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }} - *.cache-from=type=gha,scope=build-resolver-${{ github.ref }} - *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }} - *.cache-from=type=gha,scope=build-webdav-${{ github.ref }} + *.cache-from=type=gha,scope=build-docs-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-setup-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-admin-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-antispam-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-front-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-imap-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-smtp-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-resolver-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-webdav-${{ github.ref }}-${{ github.run_id }} *.platform=${{ inputs.architecture }} deploy-arm: @@ -306,20 +306,20 @@ jobs: files: ${{env.HCL_FILE}} push: true set: | - *.cache-from=type=gha,scope=build-docs - *.cache-from=type=gha,scope=build-setup - *.cache-from=type=gha,scope=build-admin - *.cache-from=type=gha,scope=build-antispam - *.cache-from=type=gha,scope=build-front - *.cache-from=type=gha,scope=build-imap - *.cache-from=type=gha,scope=build-smtp - *.cache-from=type=gha,scope=build-snappymail - *.cache-from=type=gha,scope=build-roundcube - *.cache-from=type=gha,scope=build-antivirus - *.cache-from=type=gha,scope=build-fetchmail - *.cache-from=type=gha,scope=build-resolver - *.cache-from=type=gha,scope=build-traefik-certdumper - *.cache-from=type=gha,scope=build-webdav + *.cache-from=type=gha,scope=build-docs-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-setup-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-admin-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-antispam-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-front-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-imap-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-smtp-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-resolver-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=build-webdav-${{ github.ref }}-${{ github.run_id }} *.platform=${{ inputs.architecture }} #This job creates a tagged release. A tag is created for the pinned version x.y.z. The GH release refers to this tag. From 312a733ae324c5f27be082bb9085583afbe1af7a Mon Sep 17 00:00:00 2001 From: Dimitri Huisman Date: Sat, 20 Aug 2022 09:18:54 +0000 Subject: [PATCH 3/3] prefix the cache key with a hash (to help with sharding) --- .github/workflows/build_test_deploy.yml | 86 ++++++++++++------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index dbf80bd3..3749688d 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -134,7 +134,7 @@ jobs: load: false push: false set: | - *.cache-to=type=gha,scope=build-${{ matrix.target }}-${{ github.ref }}-${{ github.run_id }},mode=min + *.cache-to=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-${{ matrix.target }}-build,mode=min *.platform=${{ inputs.architecture }} # This job runs all the tests. @@ -189,20 +189,20 @@ jobs: load: true push: false set: | - *.cache-from=type=gha,scope=build-docs-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-setup-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-admin-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-antispam-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-front-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-imap-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-smtp-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-resolver-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-webdav-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-docs-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-setup-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-admin-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-antispam-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-front-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-imap-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-smtp-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-snappymail-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-roundcube-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-antivirus-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-fetchmail-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-resolver-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-traefik-certdumper-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-webdav-build *.platform=${{ inputs.architecture }} - name: Install python packages run: python3 -m pip install -r tests/requirements.txt @@ -254,20 +254,20 @@ jobs: files: ${{env.HCL_FILE}} push: true set: | - *.cache-from=type=gha,scope=build-docs-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-setup-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-admin-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-antispam-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-front-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-imap-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-smtp-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-resolver-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-webdav-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-docs-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-setup-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-admin-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-antispam-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-front-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-imap-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-smtp-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-snappymail-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-roundcube-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-antivirus-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-fetchmail-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-resolver-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-traefik-certdumper-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-webdav-build *.platform=${{ inputs.architecture }} deploy-arm: @@ -306,20 +306,20 @@ jobs: files: ${{env.HCL_FILE}} push: true set: | - *.cache-from=type=gha,scope=build-docs-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-setup-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-admin-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-antispam-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-front-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-imap-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-smtp-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-snappymail-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-roundcube-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-antivirus-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-fetchmail-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-resolver-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-traefik-certdumper-${{ github.ref }}-${{ github.run_id }} - *.cache-from=type=gha,scope=build-webdav-${{ github.ref }}-${{ github.run_id }} + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-docs-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-setup-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-admin-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-antispam-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-front-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-imap-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-smtp-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-snappymail-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-roundcube-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-antivirus-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-fetchmail-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-resolver-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-traefik-certdumper-build + *.cache-from=type=gha,scope=${{ github.run_id }}-${{ github.ref }}-webdav-build *.platform=${{ inputs.architecture }} #This job creates a tagged release. A tag is created for the pinned version x.y.z. The GH release refers to this tag.