Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
marianogoldman committed Apr 7, 2024
1 parent f649d8d commit 546592a
Showing 1 changed file with 50 additions and 27 deletions.
77 changes: 50 additions & 27 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,53 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
env:
PAYPAL_API_CLIENT_ID: ${{ secrets.PAYPAL_API_CLIENT_ID }}
PAYPAL_API_CLIENT_SECRET: ${{ secrets.PAYPAL_API_CLIENT_SECRET }}
XDEBUG_MODE: coverage
run: composer run-script test
- uses: actions/checkout@v4

- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: "8.3"
extensions: mbstring, dom, fileinfo, intl, gd, imagick, bcmath, soap, zip, pcov
key: "extcache"

- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, dom, fileinfo, intl, gd, imagick, bcmath, soap, zip, pcov
coverage: pcov

- name: Validate composer.json and composer.lock
run: composer validate


- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
env:
PAYPAL_API_CLIENT_ID: ${{ secrets.PAYPAL_API_CLIENT_ID }}
PAYPAL_API_CLIENT_SECRET: ${{ secrets.PAYPAL_API_CLIENT_SECRET }}
XDEBUG_MODE: coverage
run: composer run-script test

0 comments on commit 546592a

Please sign in to comment.