Skip to content

格式化代码

格式化代码 #1

Workflow file for this run

name: check
on: [push, pull_request]
jobs:
phpunit:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php:
- 8.0
experimental: [false]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo, pdo_mysql, mbstring #optional, setup extensions
coverage: none #optional, setup coverage driver
- name: Check Version
run: |
php -v
php -m
composer -V
- name: Validate composer.json and composer.lock
run: composer validate
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache vendor
uses: actions/cache@v2
env:
cache-name: composer-cache
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}
- name: Install dependencies (composer.lock)
run: composer install --prefer-dist --no-progress --no-suggest
- name: Check code style
run: composer exec -- php-cs-fixer fix --config=.php-cs-fixer.php --verbose --dry-run --diff