diff --git a/.gitattributes b/.gitattributes index 590ae54..27cb9f4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,7 +9,6 @@ .gitignore export-ignore .phpcs.xml export-ignore .phpcs.xml.dist export-ignore -.travis.yml export-ignore phpcs.xml export-ignore phpcs.xml.dist export-ignore /.cache export-ignore diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a84740b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,47 @@ +name: Lint + +on: + # Run on pushes to select branches and on all pull requests. + push: + branches: + - master + - 'release/[0-9]+.[0-9]+*' + - 'hotfix/[0-9]+.[0-9]+*' + pull_request: + # Allow manually triggering the workflow. + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + # Lint against the highest/lowest supported versions of each PHP major. + # And also do a run against "nightly" (the current dev version of PHP). + php_version: ['5.6', '7.0', '7.4', '8.0', '8.1', '8.2'] + + name: "Lint: PHP ${{ matrix.php_version }}" + + # Allow builds to fail on as-of-yet unreleased PHP versions. + continue-on-error: ${{ matrix.php_version == '8.1' || matrix.php_version == '8.2' }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On + coverage: none + tools: cs2pr + + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-composer-dependencies + - name: Install Composer dependencies + uses: ramsey/composer-install@v1 + + - name: Lint against parse errors + run: composer lint -- --checkstyle | cs2pr diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 94e37ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -os: linux -language: php - -cache: - directories: - - .cache - - vendor - # Cache directory for older Composer versions. - - $HOME/.composer/cache/files - # Cache directory for more recent Composer versions. - - $HOME/.cache/composer/files - -branches: - only: - - master - - /^release\/\d+\.\d+(\.\d+)?(-\S*)?$/ - - /^hotfix\/\d+\.\d+(\.\d+)?(-\S*)?$/ - -php: - - 8.0 - - 7.4 - - 7.0 - - 5.6 - -jobs: - fast_finish: true - -before_install: - - phpenv config-rm xdebug.ini || echo 'No xdebug config.' - -install: - - | - if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then - composer install --prefer-dist --no-interaction --ignore-platform-reqs - else - composer install --prefer-dist --no-interaction - fi - -script: -# PHP Linting -- composer lint diff --git a/README.md b/README.md index 40eb69b..23ff8b6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![CS](https://github.com/Yoast/i18n-module/actions/workflows/cs.yml/badge.svg)](https://github.com/Yoast/i18n-module/actions/workflows/cs.yml) -[![Build Status](https://travis-ci.org/Yoast/i18n-module.png?branch=master)](https://travis-ci.org/Yoast/i18n-module) +[![Lint](https://github.com/Yoast/i18n-module/actions/workflows/lint.yml/badge.svg)](https://github.com/Yoast/i18n-module/actions/workflows/lint.yml) [![Code Climate](https://codeclimate.com/github/Yoast/i18n-module/badges/gpa.svg)](https://codeclimate.com/github/Yoast/i18n-module) # Yoast i18n module