Make WordPress Core

Changeset 45799


Ignore:
Timestamp:
08/14/2019 11:11:39 PM (6 years ago)
Author:
pento
Message:

Build Tools: Run composer commands in a Docker container on Travis.

This tidies up the .travis.yml file a little more.

See #47767.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.travis.yml

    r45783 r45799  
    1414    - $HOME/.npm
    1515    - vendor
    16     - $HOME/.composer/cache
    1716
    1817env:
    1918  global:
    2019    - LOCAL_DIR: build
     20    - COMPOSER_INSTALL: false
     21    - NPM_INSTALL: true
     22    - WP_INSTALL: true
    2123
    2224matrix:
     
    2426  - env: WP_TRAVISCI=test:e2e
    2527    name: E2E Tests
    26   - env: WP_TRAVISCI=travis:phpcs
     28  - env: WP_TRAVISCI=lint:php COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
    2729    name: PHP Linting
    28   - env: WP_TRAVISCI=travis:js
     30  - env: WP_TRAVISCI=travis:js WP_INSTALL=false
    2931    name: JS Tests
    3032  - env: LOCAL_PHP=7.3-fpm WP_TRAVISCI=test:php
     
    6264before_script:
    6365- |
    64   # Remove Xdebug for a huge performance increase:
    65   if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
    66     phpenv config-rm xdebug.ini
    67   else
    68     echo "xdebug.ini does not exist"
    69   fi
    70 - |
    71   # We only need to run composer install on the PHP coding standards job.
    72   if [[ "$WP_TRAVISCI" == "travis:phpcs" ]]; then
    73     composer --version
    74     travis_retry composer install
     66  if [[ "$COMPOSER_INSTALL" == "true" ]]; then
     67    docker-compose run --rm php composer --version
     68    docker-compose run --rm php composer install
    7569  fi
    7670- npm --version
    7771- node --version
    7872- nvm install 10.13.0
    79 - npm install
    80 - npm prune
     73- |
     74  if [[ "$NPM_INSTALL" == "true" ]]; then
     75    npm ci
     76  fi
    8177- |
    8278  if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
     
    9591  fi
    9692- |
    97   if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
     93  if [[ "$WP_INSTALL" == "true" ]]; then
    9894    # Run the install process after memcached has started.
    9995    npm run env:install
     
    117113      npm run test:php -- --verbose -c phpunit.xml.dist --group external-http &&
    118114      npm run test:php -- --verbose -c phpunit.xml.dist --group restapi-jsclient
     115    elif [[ "$WP_TRAVISCI" == "lint:php" ]]; then
     116      docker-compose run --rm php composer format &&
     117      docker-compose run --rm php composer lint:errors &&
     118      docker-compose run --rm php composer lint tests
    119119    else
    120120      npm run grunt $WP_TRAVISCI
Note: See TracChangeset for help on using the changeset viewer.