Changeset 50464 for branches/5.7/.github/workflows/phpunit-tests.yml
- Timestamp:
- 03/01/2021 08:21:23 PM (6 years ago)
- Location:
- branches/5.7
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
.github/workflows/phpunit-tests.yml (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.7
- Property svn:mergeinfo changed
/trunk merged: 50441-50444
- Property svn:mergeinfo changed
-
branches/5.7/.github/workflows/phpunit-tests.yml
r50413 r50464 16 16 17 17 env: 18 LOCAL_DIR: build19 18 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} 20 19 COMPOSER_INSTALL: ${{ false }} … … 22 21 PHPUNIT_SCRIPT: php 23 22 LOCAL_PHP_MEMCACHED: ${{ false }} 23 SLOW_TESTS: 'external-http,media,restapi' 24 24 25 25 jobs: 26 # Sets up WordPress for testing or development use.26 # Sets up the workflow for testing. 27 27 # 28 28 # Performs the following steps: 29 29 # - Cancels all previous workflow runs for pull requests that have not completed. 30 # - Checks out the repository. 31 # - Logs debug information about the runner container. 32 # - Installs NodeJS 14. 33 # - Sets up caching for NPM. 34 # _ Installs NPM dependencies using install-changed to hash the `package.json` file. 35 # - Builds WordPress to run from the `build` directory. 36 # - Creates a ZIP file of compiled WordPress. 37 # - Uploads ZIP file as an artifact. 38 setup-wordpress: 39 name: Setup WordPress 30 setup-workflow: 31 name: Setup Workflow 40 32 runs-on: ubuntu-latest 41 33 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} … … 47 39 with: 48 40 access_token: ${{ github.token }} 49 50 - name: Checkout repository51 uses: actions/checkout@v252 53 - name: Log debug information54 run: |55 echo "$GITHUB_REF"56 echo "$GITHUB_EVENT_NAME"57 npm --version58 node --version59 curl --version60 git --version61 svn --version62 php --version63 php -i64 locale -a65 66 - name: Install NodeJS67 uses: actions/setup-node@v268 with:69 node-version: 1470 71 - name: Cache NodeJS modules72 uses: actions/cache@v273 env:74 cache-name: cache-node-modules75 with:76 # npm cache files are stored in `~/.npm` on Linux/macOS77 path: ~/.npm78 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}79 restore-keys: |80 ${{ runner.os }}-npm-81 82 - name: Install Dependencies83 run: npx install-changed --install-command="npm ci"84 85 - name: Build WordPress86 run: npm run build87 88 - name: Create ZIP artifact89 uses: thedoctor0/zip-release@0.4.190 with:91 filename: built-wp-${{ github.sha }}.zip92 exclusions: '*.git* /*node_modules/* packagehash.txt'93 94 - name: Upload build artifact95 uses: actions/upload-artifact@v296 with:97 name: built-wp-${{ github.sha }}98 path: built-wp-${{ github.sha }}.zip99 if-no-files-found: error100 41 101 42 # Runs the PHPUnit tests for WordPress. … … 104 45 # - Set environment variables. 105 46 # - Sets up the environment variables needed for testing with memcached (if desired). 106 # - Downloads the built WordPress artifact from the previous job.107 # - Unzips the artifact.108 47 # - Installs NodeJS 14. 109 48 # - Sets up caching for NPM. 110 # _ Installs NPM dependencies using install-changed to hash the `package.json` file.49 # - Installs NPM dependencies 111 50 # - Configures caching for Composer. 112 # _Installs Composer dependencies (if desired).51 # - Installs Composer dependencies (if desired). 113 52 # - Logs Docker debug information (about both the Docker installation within the runner). 114 53 # - Starts the WordPress Docker container. … … 125 64 # - todo: Configure Slack notifications for failing tests. 126 65 test-php: 127 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 128 needs: setup-wordpress 66 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }} ${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 129 67 runs-on: ${{ matrix.os }} 130 68 strategy: … … 133 71 os: [ ubuntu-latest ] 134 72 memcached: [ false ] 73 split_slow: [ false ] 135 74 multisite: [ false, true ] 136 75 include: 76 # Additional "slow" jobs for PHP 5.6. 77 - php: '5.6.20' 78 os: ubuntu-latest 79 memcached: false 80 multisite: false 81 split_slow: true 82 - php: '5.6.20' 83 os: ubuntu-latest 84 memcached: false 85 multisite: true 86 split_slow: true 137 87 # Include jobs for PHP 7.4 with memcached. 138 88 - php: '7.4' … … 161 111 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 162 112 163 - name: Download the built WordPress artifact 164 uses: actions/download-artifact@v2 165 with: 166 name: built-wp-${{ github.sha }} 167 168 - name: Unzip built artifact 169 run: unzip built-wp-${{ github.sha }}.zip 113 - name: Checkout repository 114 uses: actions/checkout@v2 170 115 171 116 - name: Install NodeJS … … 232 177 if: ${{ matrix.memcached }} 233 178 run: | 234 cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php179 cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php 235 180 docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached 236 181 … … 257 202 run: npm run env:install 258 203 204 - name: Run slow PHPUnit tests 205 if: ${{ matrix.split_slow }} 206 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} 207 208 - name: Run PHPUnit tests for single site excluding slow tests 209 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} 210 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required 211 212 - name: Run PHPUnit tests for Multisite excluding slow tests 213 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} 214 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers 215 259 216 - name: Run PHPUnit tests 217 if: ${{ matrix.php >= '7.0' }} 260 218 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} 261 219 262 220 - name: Run AJAX tests 221 if: ${{ ! matrix.split_slow }} 263 222 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax 264 223 265 224 - name: Run ms-files tests as a multisite install 266 if: ${{ matrix.multisite }}225 if: ${{ matrix.multisite && ! matrix.split_slow }} 267 226 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files 268 227 269 228 - name: Run external HTTP tests 270 if: ${{ ! matrix.multisite }}229 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 271 230 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http 272 231 273 232 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. 274 233 - name: Run (xDebug) tests 234 if: ${{ ! matrix.split_slow }} 275 235 run: LOCAL_PHP_XDEBUG=true npm run test:${{ env.PHPUNIT_SCRIPT }} -- -v --group xdebug --exclude-group __fakegroup__ 276 236 … … 281 241 repository: 'WordPress/phpunit-test-runner' 282 242 path: 'test-runner' 283 284 - name: Set up the Git repository285 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}286 run: |287 git init288 git remote add origin https://github.com/WordPress/wordpress-develop.git289 git fetch290 git reset origin/master291 243 292 244 - name: Submit test results to the WordPress.org host test results
Note:
See TracChangeset
for help on using the changeset viewer.