Changeset 58358 for branches/5.9/.github/workflows/test-build-processes.yml
- Timestamp:
- 06/06/2024 04:34:11 PM (4 months ago)
- Location:
- branches/5.9
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
- Property svn:mergeinfo changed
/trunk merged: 53552,53895,56113-56114,57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/5.9/.github/workflows/test-build-processes.yml
r58357 r58358 1 name: Test npm1 name: Test Build Processes 2 2 3 3 on: … … 34 34 cancel-in-progress: true 35 35 36 env: 37 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} 36 # Disable permissions for all available scopes by default. 37 # Any needed permissions should be configured at the job level. 38 permissions: {} 38 39 39 40 jobs: 40 # Verifies that installing npm dependencies and building WordPress works as expected. 41 # 42 # Performs the following steps: 43 # - Checks out the repository. 44 # - Logs debug information about the GitHub Action runner. 45 # - Installs Node.js. 46 # _ Installs npm dependencies. 47 # - Builds WordPress to run from the `build` directory. 48 # - Cleans up after building WordPress to the `build` directory. 49 # - Ensures version-controlled files are not modified or deleted. 50 # - Builds WordPress to run from the `src` directory. 51 # - Cleans up after building WordPress to the `src` directory. 52 # - Ensures version-controlled files are not modified or deleted. 53 test-npm: 54 name: Test npm on ${{ matrix.os }} 55 runs-on: ${{ matrix.os }} 56 timeout-minutes: 20 41 # Tests the WordPress Core build process on multiple operating systems. 42 test-core-build-process: 43 name: Core running from ${{ matrix.directory }} 44 uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk 45 permissions: 46 contents: read 57 47 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 58 48 strategy: … … 60 50 matrix: 61 51 os: [ ubuntu-latest, windows-latest ] 52 directory: [ 'src', 'build' ] 53 include: 54 # Only prepare artifacts once. 55 - os: ubuntu-latest 56 directory: 'build' 57 prepare-playground: true 58 with: 59 os: ${{ matrix.os }} 60 directory: ${{ matrix.directory }} 61 prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }} 62 test-emoji: false 62 63 63 steps: 64 - name: Checkout repository 65 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 66 67 - name: Log debug information 68 run: | 69 npm --version 70 node --version 71 curl --version 72 git --version 73 svn --version 74 75 - name: Install Node.js 76 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 77 with: 78 node-version-file: '.nvmrc' 79 cache: npm 80 81 - name: Install Dependencies 82 run: npm ci 83 84 - name: Build WordPress 85 run: npm run build 86 87 - name: Clean after building 88 run: npm run grunt clean 89 90 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 91 run: git diff --exit-code 92 93 - name: Build WordPress in /src 94 run: npm run build:dev 95 96 - name: Clean after building in /src 97 run: npm run grunt clean -- --dev 98 99 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 100 run: git diff --exit-code 101 102 # Verifies that installing npm dependencies and building WordPress works as expected on MacOS. 64 # Tests the WordPress Core build process on MacOS. 103 65 # 104 # This is separate from the job above in order to use stricter conditions aboutwhen to run.66 # This is separate from the job above in order to use stricter conditions when determining when to run. 105 67 # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. 106 68 # … … 108 70 # currently no way to determine the OS being used on a given job. 109 71 # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. 110 # 111 # Performs the following steps: 112 # - Checks out the repository. 113 # - Logs debug information about the GitHub Action runner. 114 # - Installs Node.js. 115 # _ Installs npm dependencies. 116 # - Builds WordPress to run from the `build` directory. 117 # - Cleans up after building WordPress to the `build` directory. 118 # - Ensures version-controlled files are not modified or deleted. 119 # - Builds WordPress to run from the `src` directory. 120 # - Cleans up after building WordPress to the `src` directory. 121 # - Ensures version-controlled files are not modified or deleted. 122 test-npm-macos: 123 name: Test npm on MacOS 124 runs-on: macos-latest 125 timeout-minutes: 30 72 test-core-build-process-macos: 73 name: Core running from ${{ matrix.directory }} 74 uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk 75 permissions: 76 contents: read 126 77 if: ${{ github.repository == 'WordPress/wordpress-develop' }} 127 steps: 128 - name: Checkout repository 129 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 130 131 - name: Log debug information 132 run: | 133 npm --version 134 node --version 135 curl --version 136 git --version 137 svn --version 138 139 - name: Install Node.js 140 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 141 with: 142 node-version-file: '.nvmrc' 143 cache: npm 144 145 - name: Install Dependencies 146 run: npm ci 147 148 - name: Build WordPress 149 run: npm run build 150 151 - name: Clean after building 152 run: npm run grunt clean 153 154 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 155 run: git diff --exit-code 156 157 - name: Build WordPress in /src 158 run: npm run build:dev 159 160 - name: Clean after building in /src 161 run: npm run grunt clean -- --dev 162 163 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 164 run: git diff --exit-code 78 strategy: 79 fail-fast: false 80 matrix: 81 os: [ macos-13 ] 82 directory: [ 'src', 'build' ] 83 with: 84 os: ${{ matrix.os }} 85 directory: ${{ matrix.directory }} 86 test-emoji: false 165 87 166 88 slack-notifications: 167 89 name: Slack Notifications 168 90 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 169 needs: [ test-npm, test-npm-macos ] 91 permissions: 92 actions: read 93 contents: read 94 needs: [ test-core-build-process, test-core-build-process-macos ] 170 95 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 171 96 with: 172 calling_status: ${{ needs.test-npm.result == 'success' && needs.test-npm-macos.result == 'success' && 'success' || ( needs.test-npm.result == 'cancelled' || needs.test-npm-macos.result == 'cancelled' ) && 'cancelled' || 'failure' }}97 calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} 173 98 secrets: 174 99 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} … … 180 105 name: Failed workflow tasks 181 106 runs-on: ubuntu-latest 182 needs: [ test-npm, test-npm-macos, slack-notifications ] 107 permissions: 108 actions: write 109 needs: [ slack-notifications ] 183 110 if: | 184 111 always() && … … 187 114 github.run_attempt < 2 && 188 115 ( 189 needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure'||190 needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'116 contains( needs.*.result, 'cancelled' ) || 117 contains( needs.*.result, 'failure' ) 191 118 ) 192 119 193 120 steps: 194 121 - name: Dispatch workflow run 195 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.0122 uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 196 123 with: 197 124 retries: 2
Note: See TracChangeset
for help on using the changeset viewer.