diff --git a/.github/workflows/reusable-build-package.yml b/.github/workflows/reusable-build-package.yml index 1679f1938df17..6ee00003841ad 100644 --- a/.github/workflows/reusable-build-package.yml +++ b/.github/workflows/reusable-build-package.yml @@ -15,6 +15,8 @@ jobs: # # Performs the following steps: # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Runs the build script. # - Prepares the directory structure for the ZIP. @@ -34,6 +36,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-check-built-files.yml b/.github/workflows/reusable-check-built-files.yml index c1d05d821dec5..eb8607ee93ccf 100644 --- a/.github/workflows/reusable-check-built-files.yml +++ b/.github/workflows/reusable-check-built-files.yml @@ -16,6 +16,8 @@ jobs: # # Performs the following steps: # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Configures caching for Composer. # - Installs Composer dependencies. @@ -41,6 +43,16 @@ jobs: with: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-coding-standards-javascript.yml b/.github/workflows/reusable-coding-standards-javascript.yml index 5ad9212e7e58d..e2a5f8619d20b 100644 --- a/.github/workflows/reusable-coding-standards-javascript.yml +++ b/.github/workflows/reusable-coding-standards-javascript.yml @@ -20,6 +20,8 @@ jobs: # # Performs the following steps: # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Logs debug information about the GitHub Action runner. # - Installs npm dependencies. @@ -39,6 +41,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-end-to-end-tests.yml b/.github/workflows/reusable-end-to-end-tests.yml index 92ef4fafc32d0..337f08908beb2 100644 --- a/.github/workflows/reusable-end-to-end-tests.yml +++ b/.github/workflows/reusable-end-to-end-tests.yml @@ -48,6 +48,8 @@ jobs: # Performs the following steps: # - Sets environment variables. # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Logs debug information about the GitHub Action runner. # - Installs npm dependencies. @@ -81,6 +83,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-javascript-tests.yml b/.github/workflows/reusable-javascript-tests.yml index 0b6d28e44a93b..4e81907cdb9ea 100644 --- a/.github/workflows/reusable-javascript-tests.yml +++ b/.github/workflows/reusable-javascript-tests.yml @@ -21,6 +21,8 @@ jobs: # # Performs the following steps: # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Logs debug information about the GitHub Action runner. # - Installs npm dependencies. @@ -40,6 +42,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-performance-test-v2.yml b/.github/workflows/reusable-performance-test-v2.yml index f9259f2b5824f..ff09ced922248 100644 --- a/.github/workflows/reusable-performance-test-v2.yml +++ b/.github/workflows/reusable-performance-test-v2.yml @@ -77,7 +77,9 @@ jobs: # Performs the following steps: # - Configure environment variables. # - Checkout repository. - # - Set up Node.js. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. + # - Sets up Node.js. # - Log debug information. # - Install npm dependencies. # - Install Playwright browsers. @@ -121,6 +123,16 @@ jobs: fetch-depth: ${{ github.event_name == 'workflow_dispatch' && '2' || '1' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 45198c20f5e52..c63e0d578d408 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -101,6 +101,8 @@ jobs: # Performs the following steps: # - Sets environment variables. # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Sets up PHP. # - Installs Composer dependencies. @@ -136,6 +138,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/reusable-test-core-build-process.yml b/.github/workflows/reusable-test-core-build-process.yml index 4bec59e285c57..f5244984cd6a8 100644 --- a/.github/workflows/reusable-test-core-build-process.yml +++ b/.github/workflows/reusable-test-core-build-process.yml @@ -50,6 +50,8 @@ jobs: # # Performs the following steps: # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Logs debug information about the GitHub Action runner. # - Installs npm dependencies. @@ -75,6 +77,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + # This date is used to ensure that the PHPCS cache is cleared at least once every week. # http://man7.org/linux/man-pages/man1/date.1.html - name: "Get last Monday's date" diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index 698956ff00346..ef52f2f00d5ee 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -57,6 +57,8 @@ jobs: # Performs the following steps: # - Sets environment variables. # - Checks out the repository. + # - Retrieves the pinned commit hash for the Gutenberg repository. + # - Configures caching for the /gutenberg directory. # - Sets up Node.js. # - Sets up PHP. # - Installs Composer dependencies. @@ -91,6 +93,16 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false + - name: Retrieve the pinned Gutenberg SHA value + id: gutenberg-pinned-sha + run: echo "sha=$(jq -r '.gutenberg.ref' package.json)" >> "$GITHUB_OUTPUT" + + - name: Configure caching for Gutenberg directory. + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: gutenberg + key: gutenberg-${{ steps.gutenberg-pinned-sha.outputs.sha }}-${{ hashFiles( 'tools/gutenberg/*', 'package*.json', 'Gruntfile.js' ) }} + - name: Set up Node.js uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: