Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/actions/setup-php/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Setup PHP

inputs:
php-version:
description: 'PHP version to setup'
required: false
default: '8.4'
extensions:
description: 'Comma-separated list of PHP extensions to install'
required: false
default: 'mbstring, json, bcmath, zip, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, exif, gd, ldap, fileinfo'
tools:
description: 'Comma-separated list of tools to install'
required: false
default: composer:2.8.12, phan:5.5.1

runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
with:
php-version: ${{ inputs.php-version }}
coverage: none
extensions: ${{ inputs.extensions }}
tools: ${{ inputs.tools }}
6 changes: 1 addition & 5 deletions .github/workflows/phan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup PHP
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
with:
php-version: '8.4'
tools: phan:5.5.1
coverage: none
uses: ./.github/actions/setup-php

- name: Restore cached baseline for Phan
id: cache-baseline-restore
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
env:
PHP_EXTENSIONS: mbstring, json, bcmath, zip, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, exif, gd, ldap, fileinfo
strategy:
matrix:
# https://github.com/shivammathur/setup-php?tab=readme-ov-file#cloud-osplatform-support
Expand All @@ -25,12 +23,10 @@ jobs:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Install PHP with extensions
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
- name: Setup PHP
uses: ./.github/actions/setup-php
with:
php-version: ${{ matrix.php-version }}
coverage: none
extensions: ${{ env.PHP_EXTENSIONS }}

- name: Prepare environment
run: composer update
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup PHP
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
with:
php-version: '8.4'
uses: ./.github/actions/setup-php

- name: Install PHPStan
run: composer install
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/save-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup PHP
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
with:
php-version: '8.4'
tools: phan
coverage: none
uses: ./.github/actions/setup-php

- name: Install PHPStan
run: composer install
Expand Down
Loading