diff --git a/.gitattributes b/.gitattributes index 64d88f3..e3dd5b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,7 +7,7 @@ # /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore +/.github/ export-ignore /appveyor.yml export-ignore /box.json export-ignore /doc export-ignore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fbb685..e1e1cd8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,8 @@ on: push: tags: - 'v*' + # Allow manually triggering the workflow. + workflow_dispatch: jobs: bundle: @@ -19,7 +21,7 @@ jobs: with: php-version: 5.4 extensions: exif, phar, openssl - coverage: false + coverage: none ini-values: phar.readonly=Off - name: Install Box from GitHub @@ -33,6 +35,8 @@ jobs: - name: Install Composer dependencies uses: ramsey/composer-install@v1 + with: + composer-options: "--no-dev" - name: Building binary... run: box build -v @@ -79,7 +83,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: false + coverage: none - name: Run linter against codebase run: php ./parallel-lint.phar src/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d948369..99633a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,8 @@ on: branches: - develop - master + # Allow manually triggering the workflow. + workflow_dispatch: jobs: lint: @@ -15,9 +17,9 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' - extensions: json + php-version: '7.4' coverage: none + tools: cs2pr - name: Checkout code uses: actions/checkout@v2 @@ -26,27 +28,11 @@ jobs: uses: ramsey/composer-install@v1 - name: Run code sniffer - run: vendor/bin/phpcs + continue-on-error: true + run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml - test: - name: Run unit tests - runs-on: ubuntu-latest - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 5.4 - extensions: json, tokenizer - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install Composer dependencies - uses: ramsey/composer-install@v1 - - - name: Run tests - run: composer test + - name: Show PHPCS results in PR + run: cs2pr ./phpcs-report.xml bundle: name: Bundle binary @@ -61,7 +47,7 @@ jobs: with: php-version: 5.4 extensions: exif, phar, openssl - coverage: false + coverage: none ini-values: phar.readonly=Off - name: Install Box from GitHub @@ -75,6 +61,8 @@ jobs: - name: Install Composer dependencies uses: ramsey/composer-install@v1 + with: + composer-options: "--no-dev" - name: Building binary... run: box build -v @@ -84,8 +72,8 @@ jobs: name: parallel-lint-phar path: ./parallel-lint.phar - verify-bundle: - name: Validate binary on PHP ${{ matrix.php }} + test: + name: Run tests on PHP ${{ matrix.php }} runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental == true }} needs: @@ -113,15 +101,38 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: parallel-lint-phar - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: false + coverage: none + + # Remove PHPCS as it has a minimum PHP requirements of PHP 5.4 and would block install on PHP 5.3. + - name: 'Composer: remove PHPCS' + if: ${{ matrix.php < 5.4 }} + run: composer remove --dev squizlabs/php_codesniffer --no-update + + - name: Install Composer dependencies + uses: ramsey/composer-install@v1 + + - name: 'Integration test 1 - linting own code, no colors' + continue-on-error: true + run: ./parallel-lint --exclude vendor --exclude tests/examples --no-colors . + + - name: 'Integration test 2 - linting own code' + run: ./parallel-lint --exclude vendor --exclude tests/examples . + + - name: 'Run unit tests PHP 5.4, 5.5' + if: ${{ matrix.php < 5.6 }} + run: composer testphp5 + + - name: 'Run unit tests PHP >= 5.6' + if: ${{ matrix.php >= 5.6 }} + run: composer test + + - uses: actions/download-artifact@v2 + with: + name: parallel-lint-phar - - name: Run linter against codebase - run: php ./parallel-lint.phar src/ + - name: Run linter against codebase using the phar + run: php ./parallel-lint.phar --exclude vendor --exclude tests/examples . diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index af54d4e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: php - -matrix: - include: - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - env: SNIFF=1 - - php: 8.0 - - php: "nightly" - - fast_finish: true - - allow_failures: - # Allow failures for unstable builds. - - php: "nightly" - -install: - - composer install --no-interaction --prefer-source - -script: - - composer test - - ./parallel-lint --exclude vendor --exclude tests/examples --no-colors . - - ./parallel-lint --exclude vendor --exclude tests/examples . - - if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs;fi diff --git a/README.md b/README.md index 68c99c1..0ba4f11 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PHP Parallel Lint [![Downloads this Month](https://img.shields.io/packagist/dm/php-parallel-lint/php-parallel-lint.svg)](https://packagist.org/packages/php-parallel-lint/php-parallel-lint) -[![Build Status](https://travis-ci.org/php-parallel-lint/PHP-Parallel-Lint.svg?branch=master)](https://travis-ci.org/php-parallel-lint/PHP-Parallel-Lint) +[![Build Status](https://github.com/php-parallel-lint/PHP-Parallel-Lint/actions/workflows/test.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Parallel-Lint/actions/workflows/test.yml) [![License](https://poser.pugx.org/php-parallel-lint/php-parallel-lint/license.svg)](https://packagist.org/packages/php-parallel-lint/php-parallel-lint) This application checks syntax of PHP files in parallel. diff --git a/composer.json b/composer.json index ae978fd..9916ca7 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,8 @@ "parallel-lint" ], "scripts": { - "test": "@php vendor/bin/tester -p php tests" + "test": "@php vendor/bin/tester -C -p php tests", + "testphp5": "@php vendor/bin/tester -p php tests" }, "scripts-descriptions": { "test": "Run all tests!"