mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-01-16 14:48:32 +01:00
add cs checking to ci flow
This commit is contained in:
parent
a554210156
commit
ca17a0db74
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
@ -12,23 +12,23 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate
|
||||
|
||||
- name: Cache Composer packages
|
||||
id: composer-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor
|
||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-php-
|
||||
- name: Cache Composer packages
|
||||
id: composer-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor
|
||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-php-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||||
run: composer install --prefer-dist --no-progress --no-suggest
|
||||
- name: Install dependencies
|
||||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||||
run: composer install --prefer-dist --no-progress --no-suggest
|
||||
|
||||
- name: Run PHPUnit
|
||||
run: composer run-script test
|
||||
- name: Run PHPUnit
|
||||
run: composer run-script test
|
25
.github/workflows/code-style.yml
vendored
Normal file
25
.github/workflows/code-style.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
name: Code style
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
phpcs:
|
||||
name: PHPCS
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer update --prefer-dist --no-progress --no-suggest
|
||||
|
||||
- name: Run script
|
||||
run: vendor/bin/phpcs
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,4 +4,7 @@
|
||||
.phan
|
||||
composer.lock
|
||||
|
||||
/.phpcs-cache
|
||||
/phpcs.xml
|
||||
|
||||
.phpunit.result.cache
|
@ -12,7 +12,8 @@
|
||||
"phan/phan": "^2.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9"
|
||||
"phpunit/phpunit": "^9",
|
||||
"squizlabs/php_codesniffer": "^3.7"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit tests"
|
||||
|
9
phpcs.xml.dist
Normal file
9
phpcs.xml.dist
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
||||
|
||||
<arg name="extensions" value="php"/>
|
||||
<rule ref="PSR12"/>
|
||||
|
||||
<file>.</file>
|
||||
</ruleset>
|
Loading…
x
Reference in New Issue
Block a user