Changeset 53597 for branches/5.8/.github/workflows/test-npm.yml
- Timestamp:
- 06/30/2022 04:26:30 PM (4 years ago)
- Location:
- branches/5.8
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
.github/workflows/test-npm.yml (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
- Property svn:mergeinfo changed
/trunk merged: 51921,51924-51925,51937,52002,52130,52183,52233,53112,53581-53582,53592
- Property svn:mergeinfo changed
-
branches/5.8/.github/workflows/test-npm.yml
r51357 r53597 4 4 push: 5 5 branches: 6 - master7 6 - trunk 8 7 - '3.[7-9]' … … 10 9 pull_request: 11 10 branches: 12 - master13 11 - trunk 14 12 - '3.[7-9]' … … 41 39 # Performs the following steps: 42 40 # - Checks out the repository. 43 # - Logs debug information about the runner container.44 # - Installs NodeJS 14.41 # - Logs debug information about the GitHub Action runner. 42 # - Installs NodeJS. 45 43 # - Sets up caching for NPM. 46 # _ Installs NPM dependencies using install-changed to hash the `package.json` file.44 # _ Installs NPM dependencies. 47 45 # - Builds WordPress to run from the `build` directory. 48 46 # - Cleans up after building WordPress to the `build` directory. … … 54 52 name: Test NPM on ${{ matrix.os }} 55 53 runs-on: ${{ matrix.os }} 54 timeout-minutes: 20 56 55 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 57 56 strategy: … … 62 61 steps: 63 62 - name: Checkout repository 64 uses: actions/checkout@ 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.463 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 65 64 66 65 - name: Log debug information … … 73 72 74 73 - name: Install NodeJS 75 uses: actions/setup-node@ 46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.574 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 76 75 with: 77 node-version: 14 78 79 - name: Cache NodeJS modules (Ubuntu & MacOS) 80 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 81 if: ${{ matrix.os != 'windows-latest' }} 82 with: 83 path: ~/.npm 84 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 85 86 - name: Get NPM cache directory (Windows only) 87 if: ${{ matrix.os == 'windows-latest' }} 88 id: npm-cache 89 run: echo "::set-output name=dir::$(npm config get cache)" 90 91 - name: Cache NodeJS modules (Windows only) 92 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 93 if: ${{ matrix.os == 'windows-latest' }} 94 with: 95 path: ${{ steps.npm-cache.outputs.dir }} 96 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 76 node-version-file: '.nvmrc' 77 cache: npm 97 78 98 79 - name: Install Dependencies … … 119 100 # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS. 120 101 # 121 # This is a separate job in order to that more strict conditions can be used. 102 # This is separate from the job above in order to use stricter conditions about when to run. 103 # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. 122 104 # 123 105 # Performs the following steps: 124 106 # - Checks out the repository. 125 # - Logs debug information about the runner container.126 # - Installs NodeJS 14.107 # - Logs debug information about the GitHub Action runner. 108 # - Installs NodeJS. 127 109 # - Sets up caching for NPM. 128 # _ Installs NPM dependencies using install-changed to hash the `package.json` file.110 # _ Installs NPM dependencies. 129 111 # - Builds WordPress to run from the `build` directory. 130 112 # - Cleans up after building WordPress to the `build` directory. … … 136 118 name: Test NPM on MacOS 137 119 runs-on: macos-latest 120 timeout-minutes: 20 138 121 if: ${{ github.repository == 'WordPress/wordpress-develop' }} 139 122 steps: 140 123 - name: Checkout repository 141 uses: actions/checkout@ 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4124 uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 142 125 143 126 - name: Log debug information … … 150 133 151 134 - name: Install NodeJS 152 uses: actions/setup-node@ 46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5135 uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0 153 136 with: 154 node-version: 14 155 156 - name: Cache NodeJS modules 157 uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 158 if: ${{ matrix.os != 'windows-latest' }} 159 with: 160 path: ~/.npm 161 key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 137 node-version-file: '.nvmrc' 138 cache: npm 162 139 163 140 - name: Install Dependencies … … 181 158 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 182 159 run: git diff --exit-code 160 161 slack-notifications: 162 name: Slack Notifications 163 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 164 needs: [ test-npm, test-npm-macos ] 165 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 166 with: 167 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' }} 168 secrets: 169 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} 170 SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} 171 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 172 SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset
for help on using the changeset viewer.