From 7dd3537dd66cbcabc68812802adac02644f73781 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Wed, 14 Oct 2020 01:12:31 +0900 Subject: [PATCH] Add CS workflow --- .github/workflows/cs.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/cs.yml diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml new file mode 100644 index 00000000000..30426372755 --- /dev/null +++ b/.github/workflows/cs.yml @@ -0,0 +1,51 @@ +# yamllint disable rule:line-length + +name: Code Style + +on: + pull_request: + push: + branches: + - trunk + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: ['7.4'] + + name: PHPCS + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- + + - name: Install dependencies + run: | + composer install --prefer-dist --no-interaction --no-progress + + - name: Check code style + run: | + composer php:lint