Changeset 53598 for branches/5.7/.github/workflows/phpunit-tests.yml
- Timestamp:
- 06/30/2022 04:34:14 PM (3 years ago)
- Location:
- branches/5.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.7
-
branches/5.7/.github/workflows/phpunit-tests.yml
r51935 r53598 4 4 push: 5 5 branches: 6 - master6 - trunk 7 7 - '3.[7-9]' 8 8 - '[4-9].[0-9]' … … 12 12 pull_request: 13 13 branches: 14 - master14 - trunk 15 15 - '3.[7-9]' 16 16 - '[4-9].[0-9]' … … 20 20 - cron: '0 0 * * 0' 21 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 22 29 env: 23 30 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} … … 28 35 29 36 jobs: 30 # Sets up the workflow for testing.31 #32 # Performs the following steps:33 # - Cancels all previous workflow runs for pull requests that have not completed.34 setup-workflow:35 name: Setup Workflow36 runs-on: ubuntu-latest37 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}38 39 steps:40 - name: Cancel previous runs of this workflow (pull requests only)41 if: ${{ github.event_name == 'pull_request' }}42 uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.043 44 37 # Runs the PHPUnit tests for WordPress. 45 38 # 46 39 # Performs the following steps: 47 # - Set environment variables.40 # - Sets environment variables. 48 41 # - Sets up the environment variables needed for testing with memcached (if desired). 49 # - Installs NodeJS 14. 50 # - Sets up caching for NPM. 42 # - Installs NodeJS. 51 43 # - Installs NPM dependencies 52 44 # - Configures caching for Composer. 53 # - Installs Composer dependencies (if desired).54 # - Logs Docker debug information (about boththe Docker installation within the runner).45 # - Installs Composer dependencies. 46 # - Logs Docker debug information (about the Docker installation within the runner). 55 47 # - Starts the WordPress Docker container. 56 # - Starts the memcached server after the Docker network has been created (if desired). 57 # - Logs WordPress Docker container debug information. 58 # - Logs debug general information. 48 # - Starts the Memcached server after the Docker network has been created (if desired). 49 # - Logs general debug information about the runner. 59 50 # - Logs the running Docker containers. 51 # - Logs debug information from inside the WordPress Docker container. 60 52 # - Logs debug information about what's installed within the WordPress Docker containers. 61 53 # - Install WordPress within the Docker container. … … 64 56 # - Reconnect the directory to the Git repository. 65 57 # - Submit the test results to the WordPress.org host test results. 66 # - todo: Configure Slack notifications for failing tests.67 58 test-php: 68 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }} 59 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 69 60 runs-on: ${{ matrix.os }} 61 timeout-minutes: 20 70 62 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 71 63 strategy: … … 116 108 117 109 - name: Checkout repository 118 uses: actions/checkout@ 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4110 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 119 111 120 112 - name: Install NodeJS 121 uses: actions/setup-node@ 46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5113 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 122 114 with: 123 node-version: 14 124 125 - name: Use cached Node modules 126 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 127 env: 128 cache-name: cache-node-modules 129 with: 130 # npm cache files are stored in `~/.npm` on Linux/macOS 131 path: ~/.npm 132 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 115 node-version-file: '.nvmrc' 116 cache: npm 133 117 134 118 - name: Install Dependencies 135 run: np x install-changed --install-command="npm ci"119 run: npm ci 136 120 137 121 - name: Get composer cache directory … … 140 124 141 125 - name: Cache Composer dependencies 142 uses: actions/cache@ 26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4126 uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4 143 127 env: 144 128 cache-name: cache-composer-dependencies … … 239 223 240 224 - name: Checkout the WordPress Test Reporter 241 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/ master' && matrix.report }}242 uses: actions/checkout@ 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4225 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 226 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 243 227 with: 244 228 repository: 'WordPress/phpunit-test-runner' … … 246 230 247 231 - name: Submit test results to the WordPress.org host test results 248 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/ master' && matrix.report }}232 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 249 233 env: 250 234 WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}" 251 235 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 236 237 slack-notifications: 238 name: Slack Notifications 239 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 240 needs: [ test-php ] 241 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 242 with: 243 calling_status: ${{ needs.test-php.result == 'success' && 'success' || needs.test-php.result == 'cancelled' && 'cancelled' || 'failure' }} 244 secrets: 245 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} 246 SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} 247 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 248 SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset
for help on using the changeset viewer.