Skip to content

Composer: Improve composer scripts call and naming #96

Composer: Improve composer scripts call and naming

Composer: Improve composer scripts call and naming #96

Workflow file for this run

name: Code Analysis
on:
pull_request:
push:
jobs:
code_analysis:
strategy:
fail-fast: false
matrix:
actions:
- name: PHPStan
run: composer run phpstan
- name: Nette Tester
run: composer run test -- -C
php:
- "8.0"
- "8.1"
- "8.2"
jwt:
- name: JWT 5
key: jtw5
arg: '"firebase/php-jwt:^5.0"'
- name: JWT 6
key: jwt6
arg: '"firebase/php-jwt:^6.0"'
name: ${{ matrix.actions.name }} on PHP ${{ matrix.php }} with ${{ matrix.jwt.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# see https://github.com/shivammathur/setup-php
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
coverage: none
# see https://github.com/actions/cache/blob/main/examples.md#php---composer
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-data-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-${{ matrix.jwt.name }}
- uses: actions/cache@v2
with:
path: |
**/composer.lock
key: ${{ runner.os }}-composer-lock-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-${{ matrix.jwt.key }}
- name: Install Composer
run: composer update --no-progress --with ${{ matrix.jwt.arg }}
- name: Run job
run: ${{ matrix.actions.run }}