diff --git a/.github/workflows/lint-css.yml b/.github/workflows/lint-css.yml new file mode 100644 index 0000000..4e43a33 --- /dev/null +++ b/.github/workflows/lint-css.yml @@ -0,0 +1,23 @@ +name: CSS Code Linting + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + lint-css: + name: Lint CSS + runs-on: ubuntu-latest + steps: + - name: Checkout the git repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + - name: npm install + run: npm install + - name: Lint CSS + run: npm run lint:scss diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml new file mode 100644 index 0000000..f9ee433 --- /dev/null +++ b/.github/workflows/lint-js.yml @@ -0,0 +1,23 @@ +name: JS Code Linting + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + lint-js: + name: Lint JS + runs-on: ubuntu-latest + steps: + - name: Checkout the git repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + - name: npm install + run: npm install + - name: Lint JS + run: npm run lint:js \ No newline at end of file diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 0000000..03ca446 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,42 @@ +name: PHP Code Linting + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + lint-php: + name: Parallel lint + runs-on: ubuntu-latest + + steps: + - name: Checkout the git repository + uses: actions/checkout@v2 + - name: PHP setup + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + - name: Install composer packages + run: composer install --no-progress + - name: Check for PHP errors + run: composer lint:php + + phpcs_check: + name: PHPCS check + runs-on: ubuntu-latest + + steps: + - name: Checkout the git repository + uses: actions/checkout@v2 + - name: PHP setup + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + - name: Install composer packages + run: composer install --no-progress + - name: Check coding standards using PHPCS + run: composer lint:wpcs \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2a7a556..0000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Travis CI (MIT License) configuration file for the Underscores WordPress theme. -# @link https://travis-ci.org/ - -# For use with the Underscores WordPress theme. -# @link https://github.com/Automattic/_s - -# Tell Travis CI which OS and which distro to use. -os: linux -dist: xenial - -# Cache directories between builds. -# @link https://docs.travis-ci.com/user/caching/#arbitrary-directories -cache: - directories: - # Cache directory for npm. - - $HOME/.npm - # Cache directory for older Composer versions. - - $HOME/.composer/cache/files - # Cache directory for more recent Composer versions. - - $HOME/.cache/composer/files - -# Declare project language. -# @link https://docs.travis-ci.com/user/languages/php/ -language: - - php - -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - -jobs: - fast_finish: true - include: - - php: 7.4 - env: SNIFF=1 - -before_install: - # Speed up build time by disabling Xdebug. - - phpenv config-rm xdebug.ini || echo 'No xdebug config.' - # Download and install the latest long-term support release of node. - - if [[ "$SNIFF" == 1 ]]; then nvm install --lts; fi - # Install Composer dependencies. - - composer install - # Install NPM dependencies. - - if [[ "$SNIFF" == 1 ]]; then npm install; fi - -script: - # Validate the composer.json file. - # @link https://getcomposer.org/doc/03-cli.md#validate - - composer validate --no-check-all --strict - - # Search for PHP syntax errors using PHP Parallel Lint. - # @link https://github.com/php-parallel-lint/PHP-Parallel-Lint - - composer lint:php - - # Check the PHP files with the coding standards documented in the phpcs.xml.dist file. - - if [[ "$SNIFF" == 1 ]]; then composer lint:wpcs; fi - - # Check the JS files with the lint-js script defined in the @wordpress/scripts package. - - if [[ "$SNIFF" == 1 ]]; then npm run lint:js; fi - - # Check the SCSS files with the lint-style script defined in the @wordpress/scripts package. - - if [[ "$SNIFF" == 1 ]]; then npm run lint:scss; fi - -# Receive notifications for build results. -# @link https://docs.travis-ci.com/user/notifications/#configuring-email-notifications -notifications: - email: false