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

CI: simplify workflows with ramsey/composer-install #1095

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
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
24 changes: 3 additions & 21 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,10 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: "${{ matrix.dependencies }}"

- name: "PhpBench"
run: "make phpbench"
24 changes: 3 additions & 21 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,10 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: "${{ matrix.dependencies }}"

- name: "Coding Standard"
run: "make phpcs PHPCS_FLAGS='-q --report=checkstyle | cs2pr'"
24 changes: 3 additions & 21 deletions .github/workflows/composer-json-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,10 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, composer-normalize, composer-require-checker, composer-unused

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: "${{ matrix.dependencies }}"

- name: "Validate composer.json"
run: "composer validate --strict"
Expand Down
24 changes: 3 additions & 21 deletions .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,10 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: "${{ matrix.dependencies }}"

- name: "Infection"
run: "make infection PHPUNIT_FLAGS=--coverage-clover=coverage.xml INFECTION_FLAGS=--logger-github"
Expand Down
46 changes: 7 additions & 39 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
- "lowest"
- "highest"
- "locked"
- "development"
lcobucci marked this conversation as resolved.
Show resolved Hide resolved
php-version:
- "8.2"
- "8.3"
Expand All @@ -36,32 +35,10 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"

- name: "Install development dependencies"
if: ${{ matrix.dependencies == 'development' }}
run: "composer config minimum-stability dev && composer update --no-interaction --no-progress"
dependency-versions: "${{ matrix.dependencies }}"

- name: "Tests"
run: "make phpunit"
Expand Down Expand Up @@ -92,20 +69,11 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress --ignore-platform-req=php"
dependency-versions: "${{ matrix.dependencies }}"
composer-options: " --ignore-platform-req=php"

- name: "Tests"
run: "make phpunit"
24 changes: 3 additions & 21 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,10 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

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

- name: "Cache dependencies"
uses: "actions/[email protected]"
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
path: ${{ steps.composer-cache.outputs.composer_cache_dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: "${{ matrix.dependencies }}"

- name: "PHPStan"
run: "make phpstan"
Loading