Skip to content

Commit

Permalink
Simplify composer install in CI (#645)
Browse files Browse the repository at this point in the history
* Simplify composer install in CI

* -

* -

* -
  • Loading branch information
OskarStark authored Oct 3, 2024
1 parent 97f81c5 commit 6a9f089
Showing 1 changed file with 12 additions and 85 deletions.
97 changes: 12 additions & 85 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,10 @@ jobs:
tools: phpstan,flex
extensions: zip

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

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

- name: Install dependencies
run: composer install --prefer-dist
uses: ramsey/composer-install@v3
env:
SYMFONY_REQUIRE: 7.0.*
SYMFONY_REQUIRE: 7.0.*

- name: Install PHPUnit dependencies
run: vendor/bin/simple-phpunit --version
Expand All @@ -74,19 +63,8 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: zip

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

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

- name: Install dependencies
run: composer install --prefer-dist
uses: ramsey/composer-install@v3

- name: Run tests
run: vendor/bin/simple-phpunit
Expand All @@ -108,22 +86,11 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: zip

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

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

- name: Allow dev dependencies
run: composer config minimum-stability dev

- name: Install dependencies
run: composer install --prefer-dist
uses: ramsey/composer-install@v3

- name: Run tests
run: vendor/bin/simple-phpunit
Expand All @@ -141,19 +108,10 @@ jobs:
php-version: '8.3'
extensions: zip

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

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

- name: Install dependencies
run: composer update --prefer-dist --prefer-lowest
uses: ramsey/composer-install@v3
with:
dependency-versions: "lowest"

- name: Run tests
env:
Expand All @@ -176,19 +134,8 @@ jobs:
php-version: '8.3'
extensions: zip

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

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

- name: Install dependencies
run: composer install --prefer-dist
uses: ramsey/composer-install@v3

- name: Run tests
run: vendor/bin/simple-phpunit
Expand All @@ -206,19 +153,8 @@ jobs:
php-version: '8.3'
extensions: zip

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

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

- name: Install dependencies
run: composer install --prefer-dist
uses: ramsey/composer-install@v3

- name: Run tests
run: vendor/bin/simple-phpunit
Expand All @@ -240,19 +176,10 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: zip

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

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

- name: Install dependencies
run: composer install --prefer-dist
uses: ramsey/composer-install@v3
with:
composer-options: "--prefer-dist"

- name: Remove phpunit-bridge dependency (not yet phpunit 10 compliant)
run: composer remove --dev symfony/phpunit-bridge
Expand Down

0 comments on commit 6a9f089

Please sign in to comment.