From e44e58bda5e9ac74a6b714a46666f851455795ac Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 25 Apr 2025 01:22:03 -0500 Subject: [PATCH 1/5] refactor: Update GitHub Actions CI configuration to improve caching strategy --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0b107e0..1c8d69ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,9 +56,6 @@ jobs: # Set up Docker Buildx - name: Set up Docker Buildx uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 - with: - driver-opts: | - image=moby/buildkit:v0.12.0 # Login to GitHub Container Registry - name: Login to GitHub Container Registry uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 @@ -88,8 +85,8 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=gha,scope=${{ github.workflow }}-${{ github.job }} + cache-to: type=gha,mode=max,scope=${{ github.workflow }}-${{ github.job }} summary: name: Workflow Summary From 509871581d5dc88a0fc517a77ec386139efb815b Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 25 Apr 2025 01:45:10 -0500 Subject: [PATCH 2/5] refactor: Enhance caching strategy in GitHub Actions CI configuration --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c8d69ad..772642bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,8 +85,12 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha,scope=${{ github.workflow }}-${{ github.job }} - cache-to: type=gha,mode=max,scope=${{ github.workflow }}-${{ github.job }} + cache-from: | + type=gha,scope=${{ github.ref_name }}-${{ github.job }} + type=registry,ref=ghcr.io/${{ github.repository }}:buildcache + cache-to: | + type=gha,mode=max,scope=${{ github.ref_name }}-${{ github.job }} + type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max summary: name: Workflow Summary From 19905d62f83ddee418daaaffcd34d10d431a9055 Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 25 Apr 2025 02:05:47 -0500 Subject: [PATCH 3/5] refactor: Improve pnpm setup and caching in GitHub Actions - Updated action.yml to extract both pnpm and node versions from .tool-versions. - Enhanced caching strategy by including node_modules and .pnpm-store in cache paths. - Modified install command to use --frozen-lockfile for consistency. --- .github/actions/setup-pnpm/action.yml | 27 +++++++++++++++------------ .github/workflows/ci.yml | 2 ++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/actions/setup-pnpm/action.yml b/.github/actions/setup-pnpm/action.yml index f93e3405..8672911c 100644 --- a/.github/actions/setup-pnpm/action.yml +++ b/.github/actions/setup-pnpm/action.yml @@ -1,35 +1,38 @@ name: "Setup pnpm" -description: "Sets up pnpm with caching" +description: "Sets up pnpm with caching and installation" runs: using: composite steps: - - name: Extract pnpm version from .tool-versions - id: pnpm-version + - name: Extract versions from .tool-versions + id: versions shell: bash run: | + NODE_VERSION=$(grep 'nodejs' .tool-versions | awk '{print $1}') PNPM_VERSION=$(grep 'pnpm' .tool-versions | awk '{print $2}') - echo "Using pnpm version: $PNPM_VERSION" - echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT + echo "node=$NODE_VERSION" >> $GITHUB_OUTPUT + echo "pnpm=$PNPM_VERSION" >> $GITHUB_OUTPUT - name: Setup pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4 with: - version: ${{ steps.pnpm-version.outputs.version }} + version: ${{ steps.versions.outputs.pnpm }} - name: Get pnpm store directory shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - name: Restore pnpm cache uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + path: | + ${{ env.STORE_PATH }} + node_modules + .pnpm-store + key: ${{ runner.os }}-node-${{ steps.versions.outputs.node }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-pnpm- + ${{ runner.os }}-node-${{ steps.versions.outputs.node }}-pnpm- - name: Install dependencies shell: bash - run: pnpm install + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 772642bb..511b72a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,8 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + provenance: false cache-from: | type=gha,scope=${{ github.ref_name }}-${{ github.job }} type=registry,ref=ghcr.io/${{ github.repository }}:buildcache From 170a2ebb2eb438a18e411d9a7ca61860a490fdeb Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 25 Apr 2025 02:10:17 -0500 Subject: [PATCH 4/5] refactor: Remove provenance option from caching in GitHub Actions CI configuration --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 511b72a0..afc23668 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,6 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 - provenance: false cache-from: | type=gha,scope=${{ github.ref_name }}-${{ github.job }} type=registry,ref=ghcr.io/${{ github.repository }}:buildcache From 90928bf9aa74dfc8279ead08105ec73a20f10e32 Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 25 Apr 2025 02:11:23 -0500 Subject: [PATCH 5/5] refactor: Fix node version extraction in GitHub Actions setup - Updated action.yml to correctly extract the node version from .tool-versions. - Ensured both pnpm and node versions are outputted to $GITHUB_OUTPUT for consistency. --- .github/actions/setup-pnpm/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-pnpm/action.yml b/.github/actions/setup-pnpm/action.yml index 8672911c..f0813da8 100644 --- a/.github/actions/setup-pnpm/action.yml +++ b/.github/actions/setup-pnpm/action.yml @@ -8,10 +8,10 @@ runs: id: versions shell: bash run: | - NODE_VERSION=$(grep 'nodejs' .tool-versions | awk '{print $1}') PNPM_VERSION=$(grep 'pnpm' .tool-versions | awk '{print $2}') - echo "node=$NODE_VERSION" >> $GITHUB_OUTPUT + NODE_VERSION=$(grep 'nodejs' .tool-versions | awk '{print $2}') echo "pnpm=$PNPM_VERSION" >> $GITHUB_OUTPUT + echo "node=$NODE_VERSION" >> $GITHUB_OUTPUT - name: Setup pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4