Skip to:
Content

BuddyPress.org

Ticket #8421: 8421.4.patch

File 8421.4.patch, 5.5 KB (added by imath, 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
    - +  
     1name: Unit Tests
     2
     3on:
     4  push:
     5    branches: [ master ]
     6
     7jobs:
     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
     
    3333        "require-dev": {
    3434                "phpcompatibility/phpcompatibility-wp": "^2.1.0",
    3535                "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",
    3739                "phpunit/phpunit": "^7.5"
    3840        }
    3941}
  • package.json

    diff --git package.json package.json
    index 89f7ec1ca..0326126af 100644
     
    55        },
    66        "description": "BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!",
    77        "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",
    1010                "@wordpress/browserslist-config": "~3.0.1",
    11                 "@wordpress/env": "^3.0.2",
     11                "@wordpress/env": "^4.0.0",
    1212                "autoprefixer": "~8.5.2",
    1313                "grunt": "~1.3.0",
    1414                "grunt-check-dependencies": "~1.0.0",
     
    1818                "grunt-contrib-cssmin": "^3.0.0",
    1919                "grunt-contrib-imagemin": "~4.0.0",
    2020                "grunt-contrib-jshint": "^2.1.0",
    21                 "grunt-contrib-uglify": "^5.0.0",
     21                "grunt-contrib-uglify": "~5.0.1",
    2222                "grunt-contrib-watch": "~1.1.0",
    2323                "grunt-exec": "^3.0.0",
    2424                "grunt-jsvalidate": "~0.2.2",
    2525                "grunt-legacy-util": "^2.0.0",
    26                 "grunt-patch-wordpress": "~3.0.0",
     26                "grunt-patch-wordpress": "~3.0.1",
    2727                "grunt-postcss": "~0.9.0",
    28                 "grunt-rtlcss": "~2.0.1",
     28                "grunt-rtlcss": "~2.0.2",
    2929                "grunt-sass": "~2.0.0",
    3030                "grunt-stylelint": "~0.15.0",
    3131                "matchdep": "~2.0.0",
    3232                "parcel-bundler": "~1.12.5",
    33                 "phplint": "^2.0.1",
     33                "phplint": "~2.0.5",
    3434                "postcss-scss": "~2.0.0",
    35                 "stylelint": "~13.6.1",
     35                "stylelint": "~13.13.1",
    3636                "stylelint-config-wordpress": "~17.0.0"
    3737        },
    3838        "engines": {
     
    7474                "extends @wordpress/browserslist-config"
    7575        ],
    7676        "dependencies": {
    77                 "postcss": "~7.0.32"
     77                "postcss": "~7.0.35"
    7878        }
    7979}
  • 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'); 
    2626define( 'DB_USER', 'root');
    2727
    2828/** MySQL database password */
    29 define( 'DB_PASSWORD', '');
     29define( 'DB_PASSWORD', 'password');
    3030
    3131/** MySQL hostname */
    32 define( 'DB_HOST', 'mysql');
     32define( 'DB_HOST', 'tests-mysql');
    3333
    3434/** Database Charset to use in creating database tables. */
    3535define( 'DB_CHARSET', 'utf8');