Skip to:
Content

bbPress.org

Ticket #2542: 2542.13.diff

File 2542.13.diff, 3.2 KB (added by netweb, 7 years ago)
  • .travis.yml

     
     1# Travis CI Configuration File
     2
     3# Tell Travis CI we're using PHP
    14language: php
    25
     6# PHP version used in first build configuration.
    37php:
    48    - 5.2
    59    - 5.3
     
    610    - 5.4
    711    - 5.5
    812
     13# WordPress versions 3.7.x and above as 'develop' repo
    914env:
    1015    - WP_VERSION=master WP_MULTISITE=0
    11     - WP_VERSION=3.8 WP_MULTISITE=0
     16    - WP_VERSION=3.8.1 WP_MULTISITE=0
    1217    - WP_VERSION=3.7.1 WP_MULTISITE=0
    13     - WP_VERSION=3.6.1 WP_MULTISITE=0
    14     - WP_VERSION=3.5.2 WP_MULTISITE=0
    1518    - WP_VERSION=master WP_MULTISITE=1
    16     - WP_VERSION=3.8 WP_MULTISITE=1
     19    - WP_VERSION=3.8.1 WP_MULTISITE=1
    1720    - WP_VERSION=3.7.1 WP_MULTISITE=1
    18     - WP_VERSION=3.6.1 WP_MULTISITE=1
    19     - WP_VERSION=3.5.2 WP_MULTISITE=1
    2021
    2122before_script:
    22     # set up WP install
    23     - WP_CORE_DIR=/tmp/wordpress/
    24     - wget -nv -O /tmp/wordpress.tar.gz https://github.com/WordPress/WordPress/tarball/$WP_VERSION
    25     - mkdir -p $WP_CORE_DIR
    26     - tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
    27     - plugin_slug=$(basename $(pwd))
    28     - plugin_dir=$WP_CORE_DIR/wp-content/plugins/$plugin_slug
    29     - cd ..
    30     - mv $plugin_slug $plugin_dir
    31     # set up testing suite
    32     - export WP_TESTS_DIR=/tmp/wordpress-tests/
    33     - svn co --ignore-externals http://unit-tests.svn.wordpress.org/trunk/ $WP_TESTS_DIR
    34     - cd $WP_TESTS_DIR
     23    # setup WP_DEVELOP_DIR (needed for bbPress to bootstrap WP PhpUnit tests)
     24    - WP_DEVELOP_DIR=/tmp/wordpress
     25    # clone the WordPress develop repo
     26    - git clone git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
     27    - mv $TRAVIS_BUILD_DIR /tmp/wordpress/src/wp-content/plugins/bbpress
     28    - cd $WP_DEVELOP_DIR
     29    - git checkout $WP_VERSION
     30    # setub db
     31    - mysql -e "CREATE DATABASE wordpress_test;" -uroot
     32    # setub wp-config
    3533    - cp wp-tests-config-sample.php wp-tests-config.php
    36     - sed -i "s:dirname( __FILE__ ) . '/wordpress/':'$WP_CORE_DIR':" wp-tests-config.php
    37     - sed -i "s/yourdbnamehere/wordpress_test/" wp-tests-config.php
     34    - sed -i "s:dirname( __FILE__ ) . '/wordpress/':'$WP_DEVELOP_DIR':" wp-tests-config.php
     35    - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
    3836    - sed -i "s/yourusernamehere/root/" wp-tests-config.php
    3937    - sed -i "s/yourpasswordhere//" wp-tests-config.php
    40     # set up database
    41     - mysql -e 'CREATE DATABASE wordpress_test;' -uroot
    42     # prepare for running the tests
    43     - cd $plugin_dir/tests
     38    # prepare for running bbPress' tests
     39    - BBP_DEVELOP_DIR=$WP_DEVELOP_DIR/src/wp-content/plugins/bbpress
     40    - cd $BBP_DEVELOP_DIR
     41    # 'build' bbPress
     42    - npm install -g grunt-cli
     43    - npm install
     44    - grunt build
    4445
    45 script: phpunit
     46script: grunt travis
    4647
    4748notifications:
    4849    email: false
  • Gruntfile.js

     
    290290
    291291        grunt.registerTask( 'jstest', 'Runs all javascript tasks.', [ 'jsvalidate', 'jshint' ] );
    292292
     293        grunt.registerTask('travis', ['phpunit']);
     294
    293295        // Default task.
    294296        grunt.registerTask( 'default', [ 'build' ] );
    295297