Changeset 55482 for branches/6.0/.github/workflows/test-npm.yml
- Timestamp:
- 03/07/2023 07:36:29 PM (3 years ago)
- File:
-
- 1 edited
-
branches/6.0/.github/workflows/test-npm.yml (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0/.github/workflows/test-npm.yml
r53738 r55482 1 name: Test NPM1 name: Test npm 2 2 3 3 on: … … 16 16 - '[4-9].[0-9]' 17 17 paths: 18 # These files configure NPM. Changes could affect the outcome.18 # These files configure npm. Changes could affect the outcome. 19 19 - 'package*.json' 20 # JavaScript files are built using NPM.20 # JavaScript files are built using npm. 21 21 - '**.js' 22 # CSS and SCSS files are built using NPM.22 # CSS and SCSS files are built using npm. 23 23 - '**.scss' 24 24 - '**.css' … … 38 38 39 39 jobs: 40 # Verifies that installing NPMdependencies and building WordPress works as expected.40 # Verifies that installing npm dependencies and building WordPress works as expected. 41 41 # 42 42 # Performs the following steps: 43 43 # - Checks out the repository. 44 # - Sets up Node.js. 44 45 # - Logs debug information about the GitHub Action runner. 45 # - Installs NodeJS. 46 # _ Installs NPM dependencies. 46 # - Installs npm dependencies. 47 47 # - Builds WordPress to run from the `build` directory. 48 48 # - Cleans up after building WordPress to the `build` directory. … … 52 52 # - Ensures version-controlled files are not modified or deleted. 53 53 test-npm: 54 name: Test NPMon ${{ matrix.os }}54 name: Test npm on ${{ matrix.os }} 55 55 runs-on: ${{ matrix.os }} 56 56 timeout-minutes: 20 … … 63 63 steps: 64 64 - name: Checkout repository 65 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 65 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 66 67 - name: Set up Node.js 68 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 69 with: 70 node-version-file: '.nvmrc' 71 cache: npm 66 72 67 73 - name: Log debug information … … 73 79 svn --version 74 80 75 - name: Install NodeJS 76 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 81 - name: Install npm Dependencies 82 run: npm ci 83 84 - name: Build WordPress in /src 85 run: npm run build:dev 86 87 - name: Clean after building in /src 88 run: npm run grunt clean -- --dev 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 94 run: npm run build 95 96 - name: Clean after building 97 run: npm run grunt clean 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. 103 # 104 # This is separate from the job above in order to use stricter conditions about when to run. 105 # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. 106 # 107 # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is 108 # currently no way to determine the OS being used on a given job. 109 # 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 # - Sets up Node.js. 114 # - Logs debug information about the GitHub Action runner. 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 126 if: ${{ github.repository == 'WordPress/wordpress-develop' }} 127 steps: 128 - name: Checkout repository 129 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 130 131 - name: Set up Node.js 132 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 77 133 with: 78 134 node-version-file: '.nvmrc' 79 135 cache: npm 80 81 - name: Install Dependencies82 run: npm ci83 84 - name: Build WordPress85 run: npm run build86 87 - name: Clean after building88 run: npm run grunt clean89 90 - name: Ensure version-controlled files are not modified or deleted during building and cleaning91 run: git diff --exit-code92 93 - name: Build WordPress in /src94 run: npm run build:dev95 96 - name: Clean after building in /src97 run: npm run grunt clean -- --dev98 99 - name: Ensure version-controlled files are not modified or deleted during building and cleaning100 run: git diff --exit-code101 102 # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.103 #104 # This is separate from the job above in order to use stricter conditions about when to run.105 # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.106 #107 # Performs the following steps:108 # - Checks out the repository.109 # - Logs debug information about the GitHub Action runner.110 # - Installs NodeJS.111 # _ Installs NPM dependencies.112 # - Builds WordPress to run from the `build` directory.113 # - Cleans up after building WordPress to the `build` directory.114 # - Ensures version-controlled files are not modified or deleted.115 # - Builds WordPress to run from the `src` directory.116 # - Cleans up after building WordPress to the `src` directory.117 # - Ensures version-controlled files are not modified or deleted.118 test-npm-macos:119 name: Test NPM on MacOS120 runs-on: macos-latest121 timeout-minutes: 20122 if: ${{ github.repository == 'WordPress/wordpress-develop' }}123 steps:124 - name: Checkout repository125 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2126 136 127 137 - name: Log debug information … … 133 143 svn --version 134 144 135 - name: Install NodeJS 136 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 137 with: 138 node-version-file: '.nvmrc' 139 cache: npm 140 141 - name: Install Dependencies 145 - name: Install npm Dependencies 142 146 run: npm ci 147 148 - name: Build WordPress in /src 149 run: npm run build:dev 150 151 - name: Clean after building in /src 152 run: npm run grunt clean -- --dev 153 154 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 155 run: git diff --exit-code 143 156 144 157 - name: Build WordPress … … 147 160 - name: Clean after building 148 161 run: npm run grunt clean 149 150 - name: Ensure version-controlled files are not modified or deleted during building and cleaning151 run: git diff --exit-code152 153 - name: Build WordPress in /src154 run: npm run build:dev155 156 - name: Clean after building in /src157 run: npm run grunt clean -- --dev158 162 159 163 - name: Ensure version-controlled files are not modified or deleted during building and cleaning … … 172 176 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 173 177 SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} 178 179 failed-workflow: 180 name: Failed workflow tasks 181 runs-on: ubuntu-latest 182 needs: [ test-npm, test-npm-macos, slack-notifications ] 183 if: | 184 always() && 185 github.repository == 'WordPress/wordpress-develop' && 186 github.event_name != 'pull_request' && 187 github.run_attempt < 2 && 188 ( 189 needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' || 190 needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure' 191 ) 192 193 steps: 194 - name: Dispatch workflow run 195 uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 196 with: 197 retries: 2 198 retry-exempt-status-codes: 418 199 script: | 200 github.rest.actions.createWorkflowDispatch({ 201 owner: context.repo.owner, 202 repo: context.repo.repo, 203 workflow_id: 'failed-workflow.yml', 204 ref: 'trunk', 205 inputs: { 206 run_id: '${{ github.run_id }}' 207 } 208 });
Note: See TracChangeset
for help on using the changeset viewer.