Skip to content

Commit 7a0fb4f

Browse files
committed
minor #95 [CI] Cache Composer dependencies (Kocal)
This PR was merged into the main branch. Discussion ---------- [CI] Cache Composer dependencies | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Added Cache for Composer dependencies, either automatically with `ramsey/composer-install@v3` (for root dependencies), either manually with `actions/cache`, like we did on UX. Commits ------- 91b2db8 [CI] Cache Composer dependencies
2 parents 97e4d50 + 91b2db8 commit 7a0fb4f

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/code-quality.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,21 @@ jobs:
6464
php-version: '8.2'
6565
tools: flex
6666

67+
- name: Get composer cache directory
68+
id: composer-cache
69+
run: |
70+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
71+
72+
- name: Cache packages dependencies
73+
uses: actions/cache@v4
74+
with:
75+
path: ${{ steps.composer-cache.outputs.dir }}
76+
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }}
77+
restore-keys: |
78+
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}
79+
6780
- name: Install root dependencies
68-
run: composer install
81+
uses: ramsey/composer-install@v3
6982

7083
- name: Build root packages
7184
run: php .github/build-packages.php

.github/workflows/unit-tests.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,21 @@ jobs:
6262
tools: flex
6363
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
6464

65+
- name: Get composer cache directory
66+
id: composer-cache
67+
run: |
68+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
69+
70+
- name: Cache packages dependencies
71+
uses: actions/cache@v4
72+
with:
73+
path: ${{ steps.composer-cache.outputs.dir }}
74+
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }}
75+
restore-keys: |
76+
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}
77+
6578
- name: Install root dependencies
66-
run: composer install
79+
uses: ramsey/composer-install@v3
6780

6881
- name: Build root packages
6982
run: php .github/build-packages.php

0 commit comments

Comments
 (0)