Skip to content

Commit cc77a00

Browse files
authored
Caching Mechanism described (#9)
* Caching Mechanism described * added The cache name (key) desc * prettier-fix:v1.1.3 seablast-action:v0.2.3
1 parent 338c5f7 commit cc77a00

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/polish-the-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
timeout-minutes: 10
2727
steps:
2828
- name: Invoke the Prettier fix
29-
uses: WorkOfStan/[email protected].1
29+
uses: WorkOfStan/[email protected].3
3030
with:
3131
commit-changes: true
3232

3333
super-linter:
3434
needs: prettier-fix
35-
uses: WorkOfStan/seablast-actions/.github/workflows/[email protected].1
35+
uses: WorkOfStan/seablast-actions/.github/workflows/[email protected].3
3636
with:
3737
runs-on: "ubuntu-latest"

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,14 @@ permissions:
5050
| Output | Description |
5151
| ------------- | ----------------------------------- |
5252
| `branch-name` | The name of the branch created/used |
53+
54+
## Caching Mechanism
55+
56+
To optimize execution time, the `vendor` folder is cached, allowing dependencies to be reused across workflow runs. The cache key is generated based on:
57+
58+
- `composer.json` – to track dependency changes.
59+
- The runner's OS and PHP version – to account for environment-specific variations.
60+
61+
This approach enables cache sharing across branches. However, if the `composer.json` file in the referenced branch (e.g., `dev`) changes, it's recommended to **invalidate the cache** to ensure a fresh `vendor` folder is built from scratch.
62+
63+
The cache name (key) is `phpcs-fix-${{ runner.os }}-PHP${{ inputs.php-version }}-vendor-${{ hashFiles('**/composer.json') }}`

0 commit comments

Comments
 (0)