From 79ebfd2f2ea213c7096c24224b903ea15e45e53b Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 18:04:01 +0100 Subject: [PATCH 01/11] javascript cache test --- .github/workflows/docker.yaml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 02a7f33..d15224a 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -50,6 +50,11 @@ on: default: false type: boolean description: Use go caching mechanism + language-cache: + required: false + type: string + default: '' + description: Use caching mechanism for a given language # Permissions needed # permissions: @@ -94,21 +99,37 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - name: Go Build Cache for Docker - id: cache - if: ${{ inputs.go-cache }} + id: cache-go + if: ${{ inputs.go-cache || inputs.language-cache == 'go' }} uses: actions/cache@v4 with: path: go-build-cache key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} - name: inject go-build-cache into docker - if: ${{ inputs.go-cache }} + if: ${{ inputs.go-cache || inputs.language-cache == 'go' }} uses: reproducible-containers/buildkit-cache-dance@v3.1.2 with: cache-map: | { "go-build-cache": "/root/.cache/go-build" } - skip-extraction: ${{ steps.cache.outputs.cache-hit }} + skip-extraction: ${{ steps.cache-go.outputs.cache-hit }} + - name: Node Build Cache for Docker + id: cache-node + if: ${{ inputs.language-cache == 'javascript' }} + uses: actions/cache@v4 + with: + path: node-build-cache + key: ${{ runner.os }}-node-build-cache-${{ hashFiles('**/package.json') }} + - name: inject node-build-cache into docker + if: ${{ inputs.language-cache == 'javascript' }} + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 + with: + cache-map: | + { + "node-build-cache": "/usr/local/share/.cache/yarn/v6" + } + skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx From 5af4b5ab8c3ef8388b101955fd92ddf939c3e35c Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 18:15:44 +0100 Subject: [PATCH 02/11] Update docker.yaml --- .github/workflows/docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index d15224a..09b9e5a 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -127,7 +127,7 @@ jobs: with: cache-map: | { - "node-build-cache": "/usr/local/share/.cache/yarn/v6" + "node-build-cache": "/app/node_modules" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From faa96c6d52674bb16503c14d6fce63971803d542 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 18:22:16 +0100 Subject: [PATCH 03/11] Update docker.yaml --- .github/workflows/docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 09b9e5a..d15224a 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -127,7 +127,7 @@ jobs: with: cache-map: | { - "node-build-cache": "/app/node_modules" + "node-build-cache": "/usr/local/share/.cache/yarn/v6" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From f536879cf8fdc2cea6bdcff6c0ce0ae3210912e8 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 18:29:46 +0100 Subject: [PATCH 04/11] Update docker.yaml --- .github/workflows/docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index d15224a..f644983 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -127,7 +127,7 @@ jobs: with: cache-map: | { - "node-build-cache": "/usr/local/share/.cache/yarn/v6" + "node-build-cache": "/usr/local/share/.cache" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From 305b4ca4b94c6ef9131c9b41f146ef8911c5b96d Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 18:36:30 +0100 Subject: [PATCH 05/11] Update docker.yaml --- .github/workflows/docker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index f644983..393619f 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -120,14 +120,14 @@ jobs: uses: actions/cache@v4 with: path: node-build-cache - key: ${{ runner.os }}-node-build-cache-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-node-build-cache-${{ hashFiles('**/yarn.lock') }} - name: inject node-build-cache into docker if: ${{ inputs.language-cache == 'javascript' }} uses: reproducible-containers/buildkit-cache-dance@v3.1.2 with: cache-map: | { - "node-build-cache": "/usr/local/share/.cache" + "node-build-cache": "/root/.yarn" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From 6e92ef9b398a24649132ffef515ca9f566935036 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 18:42:15 +0100 Subject: [PATCH 06/11] Update docker.yaml --- .github/workflows/docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 393619f..c81ec53 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -127,7 +127,7 @@ jobs: with: cache-map: | { - "node-build-cache": "/root/.yarn" + "node-build-cache": "/root/.cache" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From 542d07d1bf44651c39132f0f9fc5078ffb932e8f Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 19:59:41 +0100 Subject: [PATCH 07/11] Update docker.yaml --- .github/workflows/docker.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index c81ec53..1ac6628 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -119,7 +119,9 @@ jobs: if: ${{ inputs.language-cache == 'javascript' }} uses: actions/cache@v4 with: - path: node-build-cache + path: | + node-arm64-cache + node-amd64-cache key: ${{ runner.os }}-node-build-cache-${{ hashFiles('**/yarn.lock') }} - name: inject node-build-cache into docker if: ${{ inputs.language-cache == 'javascript' }} @@ -127,7 +129,8 @@ jobs: with: cache-map: | { - "node-build-cache": "/root/.cache" + "node-arm64-cache": "/root/.cache/yarn-arm64", + "node-amd64-cache": "/root/.cache/yarn-amd64" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From 55f5219205a22cfb9505f75e4fa2132409b86daa Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 20:57:44 +0100 Subject: [PATCH 08/11] Update docker.yaml --- .github/workflows/docker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 1ac6628..ba47d4a 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -129,8 +129,8 @@ jobs: with: cache-map: | { - "node-arm64-cache": "/root/.cache/yarn-arm64", - "node-amd64-cache": "/root/.cache/yarn-amd64" + "node-arm64-cache": "/root/.cache/yarn-arm64/v6", + "node-amd64-cache": "/root/.cache/yarn-amd64/v6" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From 45f9fae1473f0018428378dfd30ee505a6f1cf9f Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 21:39:34 +0100 Subject: [PATCH 09/11] Update docker.yaml --- .github/workflows/docker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index ba47d4a..1ac6628 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -129,8 +129,8 @@ jobs: with: cache-map: | { - "node-arm64-cache": "/root/.cache/yarn-arm64/v6", - "node-amd64-cache": "/root/.cache/yarn-amd64/v6" + "node-arm64-cache": "/root/.cache/yarn-arm64", + "node-amd64-cache": "/root/.cache/yarn-amd64" } skip-extraction: ${{ steps.cache-node.outputs.cache-hit }} - name: Set up QEMU From 6ba891180a1742d5e2e6fbfe48c09a27d01e96aa Mon Sep 17 00:00:00 2001 From: cosimomeli Date: Mon, 16 Dec 2024 08:06:45 +0000 Subject: [PATCH 10/11] docs(release_notes): update RELEASE_NOTES.md [dependabot skip] --- RELEASE_NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7475a87..987f43e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,9 +1,10 @@ # GitHub Workflows Release Notes -## 0.0.3-dev - 2024-12-05 +## 0.0.3-dev - 2024-12-16 ### Features +- docker workflow: add javascript mode for cache (PR #146 by @chicco785) - golang workflow: include `.sql` and `.docker/*.yml` files in golang changes filter (PR #142 by @chicco785) - Golang & Docker workflows: add db caching to trivy (PR #138 by @chicco785) From adcf21fa81d160a87e8f77ed8a762e356c5fa69a Mon Sep 17 00:00:00 2001 From: chicco785 Date: Mon, 16 Dec 2024 08:23:19 +0000 Subject: [PATCH 11/11] docs(release_notes): update RELEASE_NOTES.md [dependabot skip] --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a04fc88..9209d9d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,8 +4,8 @@ ### Features -- docker workflow: add javascript mode for cache (PR #146 by @chicco785) - Add workflow to create a new release (PR #145 by @chicco785) +- docker workflow: add javascript mode for cache (PR #146 by @chicco785) - golang workflow: include `.sql` and `.docker/*.yml` files in golang changes filter (PR #142 by @chicco785) - Golang & Docker workflows: add db caching to trivy (PR #138 by @chicco785)