ST-11540 Fix added return type to jsonSerialize Fn #71
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
name: PHP Composer | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
php_version: "7.4" | |
jobs: | |
php-cs-fixer: | |
name: PHP-CS-Fixer | |
runs-on: ${{ vars.RUNNER_VERSION }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.php_version }} | |
tools: php-cs-fixer:v2.18.4, cs2pr | |
- name: Run PHP-CS-Fixer | |
run: | | |
IFS=' | |
' | |
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${GITHUB_SHA}..HEAD") | |
if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi | |
php-cs-fixer fix --dry-run --verbose --format=checkstyle --using-cache=no ${EXTRA_ARGS} | cs2pr | |
php-unit: | |
name: PHP Unit | |
runs-on: ${{ vars.RUNNER_VERSION }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.php_version }} | |
extensions: ${{ env.extensions }} | |
- name: Setup problem matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Execute tests | |
run: vendor/bin/phpunit --log-junit ./test-reports/junit.xml | |
- name: Archive logs | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: test-logs | |
path: storage/logs/ |