Skip to content

Commit

Permalink
Bump checkout action, use composer-install action
Browse files Browse the repository at this point in the history
  • Loading branch information
defunctl committed Aug 10, 2023
1 parent 4046046 commit 4e9dc62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,13 @@ jobs:
matrix:
os: [ubuntu-latest]
php: ['7.3', '7.4', '8.0', '8.1']
dependency-version: [prefer-stable]

name: CI - PHP ${{ matrix.php }}

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
Expand All @@ -33,9 +26,11 @@ jobs:
coverage: pcov

- name: Install Composer dependencies
run: composer update --prefer-stable --no-interaction --prefer-dist --no-suggest
uses: ramsey/composer-install@v2
with:
composer-options: "--prefer-stable --prefer-dist"

# Github workflows/actions have no tty, the script command captures the output as a work around
# GitHub workflows/actions have no tty, the script command captures the output as a work around
- name: PHPUnit Testing
run: php vendor/bin/phpunit -c ./phpunit.xml.dist

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@v3
with:
# Currently, phars built with 8.1 still work on 7.3+
php-version: '8.1'
Expand All @@ -27,9 +27,12 @@ jobs:
uses: actions/checkout@v2

- name: Install optimized composer dependencies
run: |
composer install --no-progress --no-suggest --classmap-authoritative
composer dump-autoload --no-dev --classmap-authoritative
uses: ramsey/composer-install@v2
with:
composer-options: "--classmap-authoritative"

- name: Generate dev-free composer autoloader
run: composer dump-autoload --no-dev --classmap-authoritative

- name: Build phar
run: php so app:build ${{ env.PHAR_NAME }} --build-version=${{ github.ref_name }}
Expand Down

0 comments on commit 4e9dc62

Please sign in to comment.