Skip to content

CodeIgniterを4.4に更新 #49

CodeIgniterを4.4に更新

CodeIgniterを4.4に更新 #49

name: Coding Standards
on:
pull_request:
branches:
- develop
paths:
- 'app/**'
- 'tests/**'
- composer.*
- phpcs.xml
- '.github/workflows/**'
workflow_dispatch:
jobs:
coding-standards:
name: Coding Standards
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: cs2pr
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- name: Validate composer.json
run: composer validate --strict
- name: Run PHP_CodeSniffer
run: ./vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr