Skip to content

Commit b1be116

Browse files
committed
Fix cache scope to use image name environment variables
- Change ESP-Matter cache scope from hardcoded 'esp-matter' to use ESP_MATTER_IMAGE_NAME - Now both ESP-IDF and ESP-Matter use consistent pattern: ${env.<IMAGE_NAME>}-${platform} - Update cursor rules to document cache scoping pattern - Ensures cache scopes automatically update when image names change
1 parent 48983da commit b1be116

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.cursor/rules/github-actions-standards.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ jobs:
178178
- **Job naming**: Use `<image-name>-build` and `<image-name>-manifest` pattern (e.g., `esp-idf-build`, `esp-idf-manifest`)
179179
- **Benefits of image-first naming**: Jobs for same image group together in GitHub UI when sorted alphabetically
180180
- **Image name variables**: Use descriptive uppercase names like `ESP_IDF_IMAGE_NAME`, not generic `IMAGE_NAME`
181+
- **Cache scoping**: Use image name variable for cache scope: `scope=${{ env.<IMAGE_NAME> }}-${{ steps.platform.outputs.tag }}`
181182
- Matrix builds both platforms in parallel for faster CI
182183
- Platform-specific images tagged with arch suffix (e.g., `pio-6.1.18-linux-amd64`)
183184
- Manifest job combines platform images into multi-arch manifest

.github/workflows/esp-idf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ jobs:
144144
push: ${{ github.ref_name == 'master' }}
145145
tags: |
146146
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:idf-${{ matrix.jethome_idf_base_tag }}-matter-${{ matrix.esp_matter_version }}-${{ steps.platform.outputs.tag }}
147-
cache-from: type=gha,scope=esp-matter-${{ steps.platform.outputs.tag }}
148-
cache-to: type=gha,mode=max,scope=esp-matter-${{ steps.platform.outputs.tag }}
147+
cache-from: type=gha,scope=${{ env.ESP_MATTER_IMAGE_NAME }}-${{ steps.platform.outputs.tag }}
148+
cache-to: type=gha,mode=max,scope=${{ env.ESP_MATTER_IMAGE_NAME }}-${{ steps.platform.outputs.tag }}
149149
build-args: |
150150
BASE_IMAGE_TAG=idf-${{ matrix.jethome_idf_base_tag }}-${{ steps.platform.outputs.tag }}
151151
ESP_MATTER_VERSION=${{ matrix.esp_matter_version }}

0 commit comments

Comments
 (0)