From 9dfa1750aff1b2bfad35832ed914cf2df6c587b5 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 23 Jan 2026 09:53:23 +0100 Subject: [PATCH] [FEATURE] Add Composer caching on CI This helps speed up the CI jobs, reduces load on the git servers, reduces CO2 emissions Also, it reduces the probability of availability problems of a git server of a depencency to break the CI build. Fixes #1675 --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 592b5b5d..a3bec33c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + key: "php-${{ matrix.php-version }}-typo3-12.4-Max-composer-${{ hashFiles('**/composer.json') }}" + path: .cache/composer + restore-keys: "php${{ matrix.php-version }}-typo312.4-Max-composer-\n" - name: Install Composer dependencies run: Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -s composerUpdateMax -t 13.4 - name: Lint PHP @@ -42,6 +46,12 @@ jobs: run: ./Build/Scripts/runTests.sh -s composer -- --version - name: Show the Composer configuration run: ./Build/Scripts/runTests.sh -s composer config --global --list + - name: Cache dependencies installed with composer + uses: actions/cache@v5 + with: + key: "php-${{ matrix.php-version }}-typo3-12.4-Max-composer-${{ hashFiles('**/composer.json') }}" + path: .cache/composer + restore-keys: "php-${{ matrix.php-version }}-typo3-12.4-Max-composer-\n" - name: Install Composer dependencies run: Build/Scripts/runTests.sh -s composerUpdateMax - name: Run code quality checks @@ -71,6 +81,12 @@ jobs: run: ./Build/Scripts/runTests.sh -s composer -- --version - name: Show the Composer configuration run: ./Build/Scripts/runTests.sh -s composer config --global --list + - name: Cache dependencies installed with composer + uses: actions/cache@v5 + with: + key: "php-8.2-typo3-12.4-Max-composer-${{ hashFiles('**/composer.json') }}" + path: .cache/composer + restore-keys: "php-8.2-typo3-12.4-Max-composer-\n" - name: Install Composer dependencies run: Build/Scripts/runTests.sh -s composerUpdateMax - name: Run code quality checks @@ -120,6 +136,12 @@ jobs: run: ./Build/Scripts/runTests.sh -s composer -- --version - name: Show the Composer configuration run: ./Build/Scripts/runTests.sh -s composer config --global --list + - name: Cache dependencies installed with composer + uses: actions/cache@v5 + with: + key: "php-${{ matrix.php-version }}-typo3-${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}" + path: .cache/composer + restore-keys: "php-${{ matrix.php-version }}-typo3-${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n" - name: Install composer dependencies run: | ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s composerUpdate${{matrix.composer-dependencies}} @@ -153,6 +175,12 @@ jobs: run: ./Build/Scripts/runTests.sh -s composer -- --version - name: Show the Composer configuration run: ./Build/Scripts/runTests.sh -s composer config --global --list + - name: Cache dependencies installed with composer + uses: actions/cache@v5 + with: + key: "php-${{ matrix.php-version }}-typo3-${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}" + path: .cache/composer + restore-keys: "php-${{ matrix.php-version }}-typo3-${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n" - name: Install composer dependencies run: | ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s composerUpdate${{matrix.composer-dependencies}}