Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install maximum php version found in check.php #557

Closed
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
33 changes: 15 additions & 18 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ jobs:
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Extract PHP version
id: extract-php-version
run: |
PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php)
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV

- name: Setup PHPCS
uses: shivammathur/setup-php@v2
# Install proper php version, and also install phpcs which may be needed
with:
php-version: ${{ env.PHP_VERSION }} # Version from check.php
coverage: none # disable xdebug, pcov
tools: phpcs

# Run all the precommit tools (defined into pre-commit-config.yaml).
# We can force exclusion of some of them here.
- name: Run pre-commit hooks
Expand All @@ -62,24 +77,6 @@ jobs:
# files: |
# **.php

- name: Setup PHPCS
uses: shivammathur/setup-php@v2
# Install when we're going to run phpcs
if: |
steps.changed-php.outputs.any_changed == 'true'
||
(
github.event_name == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
)
with:
php-version: 8.1
coverage: none # disable xdebug, pcov
tools: phpcs

- name: Run some pre-commit hooks on selected changed files only
if: steps.changed-php.outputs.any_changed == 'true'
env:
Expand Down