diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 014f7539..cbb5463a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Validate composer.json and composer.lock run: composer validate @@ -26,9 +26,17 @@ jobs: restore-keys: | ${{ runner.os }}-php- + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' run: composer install --prefer-dist --no-progress --no-suggest + - name: Run script + run: composer run-script cs-check + - name: Run PHPUnit run: composer run-script test diff --git a/.gitignore b/.gitignore index 96ccab44..8e409f4d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ .phan composer.lock +/.phpcs-cache +/phpcs.xml + .phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index d164a223..ce684a11 100644 --- a/composer.json +++ b/composer.json @@ -12,9 +12,11 @@ "phan/phan": "^2.7" }, "require-dev": { - "phpunit/phpunit": "^9" + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^3.7" }, "scripts": { - "test": "vendor/bin/phpunit tests" + "test": "vendor/bin/phpunit tests", + "cs-check" : "vendor/bin/phpcs" } } diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 00000000..67dfab70 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,12 @@ + + + PHP CodeSniffer configuration for The Algorithms - PHP. + + + + + . + + + +