Ticket #8421: 8421.4.patch
File 8421.4.patch, 5.5 KB (added by , 3 years ago) |
---|
-
new file .github/workflows/unit-tests.yml
diff --git .github/workflows/unit-tests.yml .github/workflows/unit-tests.yml new file mode 100644 index 000000000..24ef1fa8d
- + 1 name: Unit Tests 2 3 on: 4 push: 5 branches: [ master ] 6 7 jobs: 8 tests: 9 name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }}" 10 runs-on: ubuntu-latest 11 strategy: 12 fail-fast: false 13 matrix: 14 php: ['7.4', '8.0'] 15 wp_version: ['master'] 16 include: 17 - php: '8.0' 18 wp_version: '5.7' 19 - php: '7.4' 20 wp_version: '5.7' 21 env: 22 WP_ENV_PHP_VERSION: ${{ matrix.php }} 23 WP_VERSION: ${{ matrix.wp_version }} 24 25 steps: 26 - name: Cancel previous runs of this workflow 27 uses: styfle/cancel-workflow-action@0.5.0 28 with: 29 access_token: ${{ github.token }} 30 31 - name: Checkout repository 32 uses: actions/checkout@v2 33 34 - name: Setup PHP 35 uses: shivammathur/setup-php@v2 36 with: 37 php-version: ${{ matrix.php }} 38 tools: composer:v2 39 coverage: none 40 41 - name: Log information 42 run: | 43 echo "$GITHUB_REF" 44 echo "$GITHUB_EVENT_NAME" 45 npm --version 46 node --version 47 git --version 48 php --version 49 composer --version 50 51 - name: Validate Composer 52 run: composer validate --strict 53 54 - name: Install Composer dependencies 55 uses: ramsey/composer-install@v1 56 with: 57 composer-options: "--ignore-platform-reqs" 58 59 - name: Cache node modules 60 uses: actions/cache@v2 61 env: 62 cache-name: cache-node-modules 63 with: 64 # npm cache files are stored in `~/.npm` on Linux/macOS 65 path: ~/.npm 66 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} 67 restore-keys: | 68 ${{ runner.os }}-build-${{ env.cache-name }}- 69 ${{ runner.os }}-build- 70 ${{ runner.os }}- 71 72 - name: Validate node modules 73 run: if [[ -f package.json ]]; then npm audit --audit-level=high --production --cache ~/.npm; fi 74 75 - name: Install node modules 76 run: npm ci --cache ~/.npm 77 78 - name: Setup WordPress 79 run: echo "{\"core\":\"WordPress/WordPress#${WP_VERSION}\"}" >> .wp-env.override.json 80 81 - name: Install WordPress 82 run: | 83 chmod -R 767 ./ 84 npm run wp-env start -- --update 85 86 - name: Running single site unit tests 87 run: npm run test-php 88 if: ${{ success() || failure() }} 89 90 - name: Running multi site unit tests 91 run: npm run test-php-multisite 92 if: ${{ success() || failure() }} 93 94 - name: Stop Docker environment 95 run: npm run wp-env stop 96 if: ${{ success() || failure() }} -
composer.json
diff --git composer.json composer.json index 3bf5b45c3..92645a69f 100644
33 33 "require-dev": { 34 34 "phpcompatibility/phpcompatibility-wp": "^2.1.0", 35 35 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", 36 "wp-phpunit/wp-phpunit": "^5.6", 36 "squizlabs/php_codesniffer" : "^3.5.4", 37 "wp-coding-standards/wpcs": "*", 38 "wp-phpunit/wp-phpunit": "^5.7", 37 39 "phpunit/phpunit": "^7.5" 38 40 } 39 41 } -
package.json
diff --git package.json package.json index 89f7ec1ca..0326126af 100644
5 5 }, 6 6 "description": "BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!", 7 7 "devDependencies": { 8 "@babel/core": " ^7.11.6",9 "@wordpress/babel-preset-default": " ^5.0.1",8 "@babel/core": "~7.13.14", 9 "@wordpress/babel-preset-default": "~5.1.0", 10 10 "@wordpress/browserslist-config": "~3.0.1", 11 "@wordpress/env": "^ 3.0.2",11 "@wordpress/env": "^4.0.0", 12 12 "autoprefixer": "~8.5.2", 13 13 "grunt": "~1.3.0", 14 14 "grunt-check-dependencies": "~1.0.0", … … 18 18 "grunt-contrib-cssmin": "^3.0.0", 19 19 "grunt-contrib-imagemin": "~4.0.0", 20 20 "grunt-contrib-jshint": "^2.1.0", 21 "grunt-contrib-uglify": " ^5.0.0",21 "grunt-contrib-uglify": "~5.0.1", 22 22 "grunt-contrib-watch": "~1.1.0", 23 23 "grunt-exec": "^3.0.0", 24 24 "grunt-jsvalidate": "~0.2.2", 25 25 "grunt-legacy-util": "^2.0.0", 26 "grunt-patch-wordpress": "~3.0. 0",26 "grunt-patch-wordpress": "~3.0.1", 27 27 "grunt-postcss": "~0.9.0", 28 "grunt-rtlcss": "~2.0. 1",28 "grunt-rtlcss": "~2.0.2", 29 29 "grunt-sass": "~2.0.0", 30 30 "grunt-stylelint": "~0.15.0", 31 31 "matchdep": "~2.0.0", 32 32 "parcel-bundler": "~1.12.5", 33 "phplint": " ^2.0.1",33 "phplint": "~2.0.5", 34 34 "postcss-scss": "~2.0.0", 35 "stylelint": "~13. 6.1",35 "stylelint": "~13.13.1", 36 36 "stylelint-config-wordpress": "~17.0.0" 37 37 }, 38 38 "engines": { … … 74 74 "extends @wordpress/browserslist-config" 75 75 ], 76 76 "dependencies": { 77 "postcss": "~7.0.3 2"77 "postcss": "~7.0.35" 78 78 } 79 79 } -
tests/phpunit/assets/phpunit-wp-config.php
diff --git tests/phpunit/assets/phpunit-wp-config.php tests/phpunit/assets/phpunit-wp-config.php index 5113dd55b..25f0abd81 100644
define( 'DB_NAME', 'tests-wordpress'); 26 26 define( 'DB_USER', 'root'); 27 27 28 28 /** MySQL database password */ 29 define( 'DB_PASSWORD', ' ');29 define( 'DB_PASSWORD', 'password'); 30 30 31 31 /** MySQL hostname */ 32 define( 'DB_HOST', ' mysql');32 define( 'DB_HOST', 'tests-mysql'); 33 33 34 34 /** Database Charset to use in creating database tables. */ 35 35 define( 'DB_CHARSET', 'utf8');