Changeset 50622 for branches/5.1/.github/workflows/phpunit-tests.yml
- Timestamp:
- 03/31/2021 07:20:38 PM (4 years ago)
- Location:
- branches/5.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.1
- Property svn:mergeinfo changed
/trunk merged: 45317,50267,50379,50387,50413,50416,50432,50435-50436,50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50598
- Property svn:mergeinfo changed
-
branches/5.1/.github/workflows/phpunit-tests.yml
r50335 r50622 5 5 branches: 6 6 - master 7 - trunk 7 8 - '3.[7-9]' 8 9 - '[4-9].[0-9]' … … 11 12 - '[4-9].[0-9]*' 12 13 pull_request: 14 branches: 15 - master 16 - trunk 17 - '3.[7-9]' 18 - '[4-9].[0-9]' 19 workflow_dispatch: 13 20 # Once weekly On Sundays at 00:00 UTC. 14 21 schedule: … … 22 29 PHPUNIT_SCRIPT: php 23 30 LOCAL_PHP_MEMCACHED: ${{ false }} 31 SLOW_TESTS: 'external-http,media,restapi' 24 32 25 33 jobs: … … 44 52 - name: Cancel previous runs of this workflow (pull requests only) 45 53 if: ${{ github.event_name == 'pull_request' }} 46 uses: styfle/cancel-workflow-action@0.5.0 47 with: 48 access_token: ${{ github.token }} 54 uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 49 55 50 56 - name: Checkout repository 51 uses: actions/checkout@ v257 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 52 58 53 59 - name: Log debug information … … 65 71 66 72 - name: Install NodeJS 67 uses: actions/setup-node@ v173 uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5 68 74 with: 69 75 node-version: 14 70 76 71 77 - name: Cache NodeJS modules 72 uses: actions/cache@ v278 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 73 79 env: 74 80 cache-name: cache-node-modules … … 77 83 path: ~/.npm 78 84 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 79 restore-keys: |80 ${{ runner.os }}-npm-81 85 82 86 - name: Install Dependencies 83 run: np x install-changed --install-command="npm ci"87 run: npm ci 84 88 85 89 - name: Build WordPress … … 87 91 88 92 - name: Create ZIP artifact 89 uses: thedoctor0/zip-release@ 0.4.193 uses: thedoctor0/zip-release@a1afcab9c664c9976ac398fa831eac67bed1eb0e # v0.4.1 90 94 with: 91 95 filename: built-wp-${{ github.sha }}.zip … … 93 97 94 98 - name: Upload build artifact 95 uses: actions/upload-artifact@ v299 uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 96 100 with: 97 101 name: built-wp-${{ github.sha }} … … 125 129 # - todo: Configure Slack notifications for failing tests. 126 130 test-php: 127 name: ${{ matrix.php }}${{ matrix.m emcached && ' with memcached' || '' }} on ${{ matrix.os }}131 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }} ${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 128 132 needs: setup-wordpress 129 133 runs-on: ${{ matrix.os }} 130 134 strategy: 135 fail-fast: false 131 136 matrix: 132 php: [ '7.3' ] 133 phpunit: [ '7.3' ] 137 php: [ '5.3', '5.4', '5.5', '7.1', '7.2', '7.3' ] 134 138 os: [ ubuntu-latest ] 135 139 memcached: [ false ] 140 split_slow: [ false ] 141 multisite: [ false, true ] 136 142 include: 137 # Include job for PHP 7.3 with memcached.143 # Include jobs for PHP 7.3 with memcached. 138 144 - php: '7.3' 139 phpunit: '7.3' 140 os: ubuntu-latest 141 memcached: false 142 - php: '7.2' 143 phpunit: '7.2' 144 os: ubuntu-latest 145 memcached: false 146 - php: '7.1' 147 phpunit: '7.1' 148 os: ubuntu-latest 149 memcached: false 145 os: ubuntu-latest 146 memcached: true 147 split_slow: false 148 multisite: false 149 - php: '7.3' 150 os: ubuntu-latest 151 memcached: true 152 split_slow: false 153 multisite: true 154 # Include jobs when specific PHPUnit versions are required. 150 155 - php: '7.0' 151 156 phpunit: '6-php-7.0' 152 157 os: ubuntu-latest 153 158 memcached: false 159 multisite: false 160 - php: '7.0' 161 phpunit: '6-php-7.0' 162 os: ubuntu-latest 163 memcached: false 164 multisite: true 154 165 - php: '5.6' 155 166 phpunit: '4-php-5.6' 156 167 os: ubuntu-latest 157 168 memcached: false 169 multisite: false 170 - php: '5.6' 171 phpunit: '4-php-5.6' 172 os: ubuntu-latest 173 memcached: false 174 multisite: true 175 # Additional "slow" jobs for PHP <= 5.6. 176 - php: '5.6' 177 phpunit: '4-php-5.6' 178 os: ubuntu-latest 179 memcached: false 180 split_slow: true 181 multisite: false 182 - php: '5.6' 183 phpunit: '4-php-5.6' 184 os: ubuntu-latest 185 memcached: false 186 split_slow: true 187 multisite: true 158 188 - php: '5.5' 159 phpunit: '5.5' 160 os: ubuntu-latest 161 memcached: false 189 os: ubuntu-latest 190 memcached: false 191 split_slow: true 192 multisite: false 193 - php: '5.5' 194 os: ubuntu-latest 195 memcached: false 196 split_slow: true 197 multisite: true 162 198 - php: '5.4' 163 phpunit: '5.4' 164 os: ubuntu-latest 165 memcached: false 199 os: ubuntu-latest 200 memcached: false 201 split_slow: true 202 multisite: false 203 - php: '5.4' 204 os: ubuntu-latest 205 memcached: false 206 split_slow: true 207 multisite: true 166 208 - php: '5.3' 167 phpunit: '5.3' 168 os: ubuntu-latest 169 memcached: false 209 os: ubuntu-latest 210 memcached: false 211 split_slow: true 212 multisite: false 213 - php: '5.3' 214 os: ubuntu-latest 215 memcached: false 216 split_slow: true 217 multisite: true 218 170 219 env: 171 220 LOCAL_PHP: ${{ matrix.php }}-fpm 172 LOCAL_PHPUNIT: ${{ matrix.phpunit }}-fpm221 LOCAL_PHPUNIT: ${{ matrix.phpunit && matrix.phpunit || matrix.php }}-fpm 173 222 LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }} 223 PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 174 224 175 225 steps: … … 180 230 181 231 - name: Download the built WordPress artifact 182 uses: actions/download-artifact@ v2232 uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 183 233 with: 184 234 name: built-wp-${{ github.sha }} … … 188 238 189 239 - name: Install NodeJS 190 uses: actions/setup-node@ v1240 uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5 191 241 with: 192 242 node-version: 14 193 243 194 244 - name: Use cached Node modules 195 uses: actions/cache@ v2245 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 196 246 env: 197 247 cache-name: cache-node-modules … … 200 250 path: ~/.npm 201 251 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 202 restore-keys: |203 ${{ runner.os }}-npm-204 252 205 253 - name: Install Dependencies 206 run: np x install-changed --install-command="npm ci"254 run: npm ci 207 255 208 256 - name: Cache Composer dependencies 209 257 if: ${{ env.COMPOSER_INSTALL == true }} 210 uses: actions/cache@ v2258 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 211 259 env: 212 260 cache-name: cache-composer-dependencies … … 214 262 path: ${{ steps.composer-cache.outputs.dir }} 215 263 key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} 216 restore-keys: |217 ${{ runner.os }}-php-${{ matrix.php }}-composer-218 264 219 265 - name: Install Composer dependencies … … 261 307 run: npm run env:install 262 308 309 - name: Run slow PHPUnit tests 310 if: ${{ matrix.split_slow }} 311 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} 312 313 - name: Run PHPUnit tests for single site excluding slow tests 314 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} 315 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required 316 317 - name: Run PHPUnit tests for Multisite excluding slow tests 318 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} 319 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers 320 263 321 - name: Run PHPUnit tests 264 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist 322 if: ${{ matrix.php >= '7.0' }} 323 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} 265 324 266 325 - name: Run AJAX tests 267 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group ajax 268 269 - name: Run tests as a multisite install 270 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml 326 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 327 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax 271 328 272 329 - name: Run ms-files tests as a multisite install 330 if: ${{ matrix.multisite && ! matrix.split_slow }} 273 331 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files 274 332 275 333 - name: Run external HTTP tests 334 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 276 335 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http 277 278 - name: Run REST API tests279 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient280 336 281 337 - name: Checkout the WordPress Test Reporter 282 338 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }} 283 uses: actions/checkout@ v2339 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 284 340 with: 285 341 repository: 'WordPress/phpunit-test-runner'
Note: See TracChangeset
for help on using the changeset viewer.