Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify composer install in CI #645

Merged
merged 4 commits into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading