Create php.yml #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Composer | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ ubuntu-latest, macos-latest ] #windows-latest currently not working | |
php-versions: [ '8.1', '8.2'] | |
composer-deps: ['lock'] | |
composer-versions: [ 'composer:v2' ] | |
fail-fast: false | |
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-versions }} ${{ matrix.composer-deps }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install PHP | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: ${{ matrix.composer-versions }} | |
extensions: xdebug, mbstring, posix | |
- name: Check Versions | |
run: | | |
php -v | |
php -m | |
composer --version | |
- 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 (lock) | |
env: | |
COMPOSER_AUTH: '{"http-basic":{"repo.magento.com":{"username":"${{secrets.MAGENTO_AUTH_USER}}","password":"${{secrets.MAGENTO_AUTH_PASS}}"}}}' | |
run: | | |
composer install --no-progress --no-suggest | |
- name: Run the tests on unix | |
run: php vendor/bin/grumphp run --no-interaction |