kontent-ai.github.io

What the Action does

This action sets up the PHP environment on the Ubuntu machine. It validates and caches Composer packages. In the end, it runs a code coverage tool by Codecov. The package is then available on the Packagist repository.

Notes

GitHub Action example

on: push: branches: [ master ] pull_request: branches: [ master ]

jobs: build: runs-on: ubuntu-latest strategy: matrix:
php-versions: [‘7.0’, ‘7.1’, ‘7.2’, ‘7.3’] phpunit-versions: [‘latest’] steps: - uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: $ extensions: mbstring, intl ini-values: post_max_size=256M, max_execution_time=180 coverage: xdebug
tools: php-cs-fixer, phpunit:$ - name: Validate composer.json and composer.lock run: composer validate –strict - name: Cache Composer packages id: composer-cache uses: actions/cache@v2 with: path: vendor key: $-php-$ restore-keys: | $-php- - name: Install dependencies run: composer install –prefer-dist –no-progress –no-suggest - name: Coverage run: vendor/bin/phpunit –coverage-clover coverage.xml - name: Codecov uses: codecov/codecov-action@v1
```