Skip to content

Commit

Permalink
Use ramsey/composer-install
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Sep 18, 2024
1 parent af55f65 commit 44c53bf
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 113 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/bcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,9 @@ jobs:
with:
fetch-depth: 0

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
- name: Cache composer cache
uses: actions/cache@v4
- uses: ramsey/composer-install@v3
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: |
composer install -o
composer bin bcc install
composer-options: "--optimize-autoloader"
env:
COMPOSER_ROOT_VERSION: dev-master

Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,12 @@ jobs:
with:
fetch-depth: 0 # required for composer to automatically detect root package version

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
- name: Cache composer cache
uses: actions/cache@v4
- uses: ramsey/composer-install@v3
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: composer install -o
# DO NOT set this, we need composer to figure out the version itself
# env:
# COMPOSER_ROOT_VERSION: dev-master
composer-options: "--optimize-autoloader"
# DO NOT set this, we need composer to figure out the version itself
# env:
# COMPOSER_ROOT_VERSION: dev-master

- run: bin/build-phar.sh
env:
Expand Down
32 changes: 5 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ jobs:
matrix:
php-version:
- "8.0"
#- "8.1"
#- "8.2"
#- "8.3"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
count: ${{ fromJson(needs.chunk-matrix.outputs.count) }}
chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }}
Expand All @@ -153,31 +153,9 @@ jobs:

- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "files_cache=$(composer config cache-files-dir -q | grep '.cache/composer')" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir -q | grep '.cache/composer')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v4
- uses: ramsey/composer-install@v3
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: composer install -o
composer-options: "--optimize-autoloader"
env:
COMPOSER_ROOT_VERSION: dev-master

Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/shepherd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
ini-values: zend.assertions=1
tools: composer:v2
coverage: none
env:
fail-fast: true
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
ini-values: zend.assertions=1
tools: composer:v2
coverage: none
env:
fail-fast: true

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
env:
COMPOSER_ROOT_VERSION: dev-master
- uses: ramsey/composer-install@v3
with:
composer-options: "--optimize-autoloader"
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Run Psalm
run: ./psalm --threads=2 --output-format=github --shepherd
- name: Run Psalm
run: ./psalm --threads=2 --output-format=github --shepherd
26 changes: 2 additions & 24 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,9 @@ jobs:

- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
shell: bash

- name: Generate composer.lock
run: |
composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v4
- uses: ramsey/composer-install@v3
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: composer install -o
composer-options: "--optimize-autoloader"
env:
COMPOSER_ROOT_VERSION: dev-master

Expand Down

0 comments on commit 44c53bf

Please sign in to comment.