Changeset 53622 for branches/3.9/.github/workflows/phpunit-tests.yml
- Timestamp:
- 06/30/2022 05:29:42 PM (2 years ago)
- Location:
- branches/3.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9
- Property svn:mergeinfo changed
/trunk merged: 50704,50930,51341,51355,51498,51511,51535,51921,51924-51925,51937,52002,52130,52183,52233,53112,53581-53582,53592
- Property svn:mergeinfo changed
-
branches/3.9/.github/workflows/phpunit-tests.yml
r50645 r53622 4 4 push: 5 5 branches: 6 - master7 6 - trunk 8 7 - '3.[7-9]' … … 13 12 pull_request: 14 13 branches: 15 - master16 14 - trunk 17 15 - '3.[7-9]' … … 22 20 - cron: '0 0 * * 0' 23 21 22 # Cancels all previous workflow runs for pull requests that have not completed. 23 concurrency: 24 # The concurrency group contains the workflow name and the branch name for pull requests 25 # or the commit hash for any other events. 26 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} 27 cancel-in-progress: true 28 24 29 env: 25 30 LOCAL_DIR: build … … 36 41 # - Cancels all previous workflow runs for pull requests that have not completed. 37 42 # - Checks out the repository. 38 # - Logs debug information about the runner container. 39 # - Installs NodeJS 14. 40 # - Sets up caching for NPM. 41 # _ Installs NPM dependencies using install-changed to hash the `package.json` file. 43 # - Logs debug information about the GitHub Action runner. 44 # - Installs NodeJS. 45 # _ Installs NPM dependencies. 42 46 # - Builds WordPress to run from the `build` directory. 43 47 # - Creates a ZIP file of compiled WordPress. … … 49 53 50 54 steps: 51 - name: Cancel previous runs of this workflow (pull requests only)52 if: ${{ github.event_name == 'pull_request' }}53 uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.054 55 55 - name: Checkout repository 56 uses: actions/checkout@ 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.456 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 57 57 58 58 - name: Log debug information … … 70 70 71 71 - name: Install NodeJS 72 uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5 73 with: 74 node-version: 14 75 76 - name: Cache NodeJS modules 77 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 78 env: 79 cache-name: cache-node-modules 80 with: 81 # npm cache files are stored in `~/.npm` on Linux/macOS 82 path: ~/.npm 83 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 72 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 73 with: 74 node-version-file: '.nvmrc' 75 cache: npm 84 76 85 77 - name: Install Dependencies … … 90 82 91 83 - name: Create ZIP artifact 92 uses: thedoctor0/zip-release@ a1afcab9c664c9976ac398fa831eac67bed1eb0e # v0.4.184 uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657 # v0.6.2 93 85 with: 94 86 filename: built-wp-${{ github.sha }}.zip … … 96 88 97 89 - name: Upload build artifact 98 uses: actions/upload-artifact@ e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.290 uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 99 91 with: 100 92 name: built-wp-${{ github.sha }} … … 105 97 # 106 98 # Performs the following steps: 107 # - Set environment variables.99 # - Sets environment variables. 108 100 # - Sets up the environment variables needed for testing with memcached (if desired). 109 101 # - Downloads the built WordPress artifact from the previous job. 110 102 # - Unzips the artifact. 111 # - Installs NodeJS 14. 112 # - Sets up caching for NPM. 113 # _ Installs NPM dependencies using install-changed to hash the `package.json` file. 103 # - Installs NodeJS. 104 # _ Installs NPM dependencies. 114 105 # - Configures caching for Composer. 115 106 # _ Installs Composer dependencies (if desired). 116 # - Logs Docker debug information (about boththe Docker installation within the runner).107 # - Logs Docker debug information (about the Docker installation within the runner). 117 108 # - Starts the WordPress Docker container. 118 # - Starts the memcached server after the Docker network has been created (if desired). 119 # - Logs WordPress Docker container debug information. 120 # - Logs debug general information. 109 # - Starts the Memcached server after the Docker network has been created (if desired). 110 # - Logs general debug information about the runner. 121 111 # - Logs the running Docker containers. 112 # - Logs debug information from inside the WordPress Docker container. 122 113 # - Logs debug information about what's installed within the WordPress Docker containers. 123 114 # - Install WordPress within the Docker container. … … 126 117 # - Reconnect the directory to the Git repository. 127 118 # - Submit the test results to the WordPress.org host test results. 128 # - todo: Configure Slack notifications for failing tests.129 119 test-php: 130 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }} 120 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 131 121 needs: setup-wordpress 132 122 runs-on: ${{ matrix.os }} 123 timeout-minutes: 20 133 124 strategy: 134 125 fail-fast: false … … 151 142 152 143 - name: Download the built WordPress artifact 153 uses: actions/download-artifact@ 4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8144 uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 154 145 with: 155 146 name: built-wp-${{ github.sha }} … … 159 150 160 151 - name: Install NodeJS 161 uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5 162 with: 163 node-version: 14 164 165 - name: Use cached Node modules 166 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 167 env: 168 cache-name: cache-node-modules 169 with: 170 # npm cache files are stored in `~/.npm` on Linux/macOS 171 path: ~/.npm 172 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 152 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 153 with: 154 node-version-file: '.nvmrc' 155 cache: npm 173 156 174 157 - name: Install Dependencies … … 177 160 - name: Cache Composer dependencies 178 161 if: ${{ env.COMPOSER_INSTALL == true }} 179 uses: actions/cache@ 26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4162 uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4 180 163 env: 181 164 cache-name: cache-composer-dependencies … … 253 236 254 237 - name: Checkout the WordPress Test Reporter 255 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/ master' && matrix.report }}256 uses: actions/checkout@ 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4238 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 239 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 257 240 with: 258 241 repository: 'WordPress/phpunit-test-runner' … … 260 243 261 244 - name: Set up the Git repository 262 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/ master' && matrix.report }}245 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 263 246 run: | 264 247 git init 265 248 git remote add origin https://github.com/WordPress/wordpress-develop.git 266 249 git fetch 267 git reset origin/ master250 git reset origin/trunk 268 251 269 252 - name: Submit test results to the WordPress.org host test results 270 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/ master' && matrix.report }}253 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 271 254 env: 272 255 WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}" 273 256 run: docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php 257 258 slack-notifications: 259 name: Slack Notifications 260 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 261 needs: [ setup-wordpress, test-php ] 262 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 263 with: 264 calling_status: ${{ needs.test-php.result == 'success' && 'success' || needs.test-php.result == 'cancelled' && 'cancelled' || 'failure' }} 265 secrets: 266 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} 267 SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} 268 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 269 SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset
for help on using the changeset viewer.