Skip to content

Commit

Permalink
minor #1551 Remove the composer cache from the CI workflows (rosier)
Browse files Browse the repository at this point in the history
This PR was merged into the main branch.

Discussion
----------

Remove the composer cache from the CI workflows

I think there is little benefit anymore for this repository to have a composer cache in the CI workflows. With composer v2 the dependencies are downloaded in parallel which is a lot faster than composer v1. This makes the performance gains from the cache small since it also takes time to setup and save or restore the cache.

Also the chance for a cache hit is low:
- This repository has low traffic and the cache expires after a week which reduces the chance for a cache hit.
- Every branch / PR get it's own cache which again reduces the chance for a cache hit.

So I purpose to remove the composer cache to simplify the workflows.

Replaces: #1538

Commits
-------

a4baa11 Remove the composer cache from the CI workflows
  • Loading branch information
javiereguiluz committed Jan 3, 2025
2 parents 2456e31 + a4baa11 commit db2c20e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: "Set composer cache directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: "Cache composer"
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: "Install dependencies"
run: composer install --ansi --no-interaction --no-progress

Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ jobs:
- name: "Add PHPUnit matcher"
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: "Set composer cache directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
shell: bash

- name: "Cache composer"
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: "Install dependencies"
run: composer install --ansi --no-interaction --no-progress

Expand Down

0 comments on commit db2c20e

Please sign in to comment.