Fix: Configure platform in composer.json
#180
Workflow file for this run
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
# https://docs.github.com/en/actions | |
name: "Integrate" | |
on: # yamllint disable-line rule:truthy | |
pull_request: null | |
push: | |
branches: | |
- "master" | |
env: | |
PHP_EXTENSIONS: "mbstring" | |
jobs: | |
coding-standards: | |
name: "Coding Standards" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.1" | |
dependencies: | |
- "locked" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Lint YAML files" | |
uses: "ibiqlik/[email protected]" | |
with: | |
config_file: ".yamllint.yaml" | |
file_or_dir: "." | |
strict: true | |
- name: "Install PHP with extensions" | |
uses: "shivammathur/[email protected]" | |
with: | |
coverage: "none" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
php-version: "${{ matrix.php-version }}" | |
- name: "Validate composer.json and composer.lock" | |
run: "composer validate --ansi --strict" | |
- name: "Determine composer cache directory" | |
uses: "./.github/actions/composer/composer/determine-cache-directory" | |
- name: "Cache dependencies installed with composer" | |
uses: "actions/cache@v4" | |
with: | |
path: "${{ env.COMPOSER_CACHE_DIR }}" | |
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | |
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | |
uses: "./.github/actions/composer/composer/install" | |
with: | |
dependencies: "${{ matrix.dependencies }}" | |
- name: "Run ergebnis/composer-normalize" | |
run: "composer normalize --ansi --dry-run" | |
- name: "Cache cache directory for friendsofphp/php-cs-fixer" | |
uses: "actions/cache@v4" | |
with: | |
path: ".build/php-cs-fixer" | |
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}" | |
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" | |
- name: "Run friendsofphp/php-cs-fixer" | |
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose" | |
static-code-analysis: | |
name: "Static Code Analysis" | |
runs-on: "ubuntu-latest" | |
strategy: | |
fail-fast: false | |
matrix: | |
phpunit-version: | |
- "6.0.0" | |
php-version: | |
- "7.1" | |
- "7.2" | |
- "7.3" | |
- "7.4" | |
dependencies: | |
- "lowest" | |
- "locked" | |
- "highest" | |
include: | |
- phpunit-version: "7.0.0" | |
php-version: "7.1" | |
dependencies: "lowest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.1" | |
dependencies: "highest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.2" | |
dependencies: "lowest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.2" | |
dependencies: "highest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.3" | |
dependencies: "lowest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.3" | |
dependencies: "highest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.4" | |
dependencies: "lowest" | |
- phpunit-version: "7.0.0" | |
php-version: "7.4" | |
dependencies: "highest" | |
- phpunit-version: "8.0.0" | |
php-version: "7.2" | |
dependencies: "lowest" | |
- phpunit-version: "8.0.0" | |
php-version: "7.2" | |
dependencies: "highest" | |
- phpunit-version: "8.0.0" | |
php-version: "7.3" | |
dependencies: "lowest" | |
- phpunit-version: "8.0.0" | |
php-version: "7.3" | |
dependencies: "highest" | |
- phpunit-version: "8.0.0" | |
php-version: "7.4" | |
dependencies: "lowest" | |
- phpunit-version: "8.0.0" | |
php-version: "7.4" | |
dependencies: "highest" | |
- phpunit-version: "9.0.0" | |
php-version: "7.3" | |
dependencies: "lowest" | |
- phpunit-version: "9.0.0" | |
php-version: "7.3" | |
dependencies: "highest" | |
- phpunit-version: "9.0.0" | |
php-version: "7.4" | |
dependencies: "lowest" | |
- phpunit-version: "9.0.0" | |
php-version: "7.4" | |
dependencies: "highest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP with extensions" | |
uses: "shivammathur/[email protected]" | |
with: | |
coverage: "none" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
php-version: "${{ matrix.php-version }}" | |
- name: "Determine composer cache directory" | |
uses: "./.github/actions/composer/composer/determine-cache-directory" | |
- name: "Cache dependencies installed with composer" | |
uses: "actions/cache@v4" | |
with: | |
path: "${{ env.COMPOSER_CACHE_DIR }}" | |
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | |
- name: "Remove platform configuration with composer" | |
if: "matrix.dependencies != 'locked'" | |
run: "composer config platform.php --ansi --unset" | |
- name: "Require phpunit/phpunit:^${{ matrix.phpunit-version }}" | |
run: "composer require --ansi --dev phpunit/phpunit:^${{ matrix.phpunit-version }} --update-with-dependencies" | |
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | |
uses: "./.github/actions/composer/composer/install" | |
with: | |
dependencies: "${{ matrix.dependencies }}" | |
- name: "Cache cache directory for phpstan/phpstan" | |
uses: "actions/cache@v4" | |
with: | |
path: ".build/phpstan" | |
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}" | |
restore-keys: "php-${{ matrix.php-version }}-phpstan-" | |
- name: "Show phpstan/phpstan version" | |
run: "vendor/bin/phpstan --ansi --version" | |
- name: "Show phpunit/phpunit version" | |
run: "vendor/bin/phpunit --version" | |
- name: "Run phpstan/phpstan with extension" | |
run: "vendor/bin/phpstan analyse --ansi --configuration=phpstan-with-extension.neon --memory-limit=-1" | |
- name: "Run phpstan/phpstan without extension" | |
run: "vendor/bin/phpstan analyse --ansi --configuration=phpstan-without-extension.neon --memory-limit=-1" | |
tests: | |
name: "Tests" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.1" | |
dependencies: | |
- "locked" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP with extensions" | |
uses: "shivammathur/[email protected]" | |
with: | |
coverage: "none" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
php-version: "${{ matrix.php-version }}" | |
- name: "Set up problem matchers for phpunit/phpunit" | |
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" | |
- name: "Determine composer cache directory" | |
uses: "./.github/actions/composer/composer/determine-cache-directory" | |
- name: "Cache dependencies installed with composer" | |
uses: "actions/cache@v4" | |
with: | |
path: "${{ env.COMPOSER_CACHE_DIR }}" | |
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | |
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | |
uses: "./.github/actions/composer/composer/install" | |
with: | |
dependencies: "${{ matrix.dependencies }}" | |
- name: "Run tests with phpunit/phpunit" | |
run: "vendor/bin/phpunit --configuration=phpunit.xml" |