Skip to content

Commit e49582e

Browse files
committed
Ensure updated certificate files are included
1 parent 68ac4ab commit e49582e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/reusable-test-core-build-process.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ on:
1717
type: 'string'
1818
default: 'src'
1919
test-emoji:
20-
description: 'Whether to run the grunt precommit:emoji script.'
20+
description: 'Whether to run the precommit:emoji Grunt script.'
2121
required: false
2222
type: 'boolean'
2323
default: true
24+
test-certificates:
25+
description: 'Whether to run the certificate related Grunt scripts.'
26+
required: false
27+
type: 'boolean'
28+
default: false
2429
save-build:
2530
description: 'Whether to save a ZIP of built WordPress as an artifact.'
2631
required: false
@@ -69,6 +74,21 @@ jobs:
6974
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
7075
persist-credentials: false
7176

77+
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
78+
# http://man7.org/linux/man-pages/man1/date.1.html
79+
- name: "Get last Monday's date"
80+
id: get-date
81+
if: ${{ inputs.test-certificates }}
82+
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
83+
84+
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
85+
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
86+
- name: Install Composer dependencies
87+
if: ${{ inputs.test-certificates }}
88+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
89+
with:
90+
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
91+
7292
- name: Set up Node.js
7393
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7494
with:
@@ -91,6 +111,10 @@ jobs:
91111
env:
92112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93113

114+
- name: Ensure certificates files are updated
115+
if: ${{ inputs.test-certificates }}
116+
run: npm run grunt copy:certificates && npm run grunt build:certificates
117+
94118
- name: Build WordPress to run from ${{ inputs.directory }}
95119
run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }}
96120

.github/workflows/test-build-processes.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ jobs:
5959
matrix:
6060
os: [ 'ubuntu-24.04' ]
6161
directory: [ 'src', 'build' ]
62+
test-certificates: [ true ]
6263
include:
6364
# Only prepare artifacts for Playground once.
6465
- os: 'ubuntu-24.04'
6566
directory: 'build'
6667
save-build: true
6768
prepare-playground: ${{ github.event_name == 'pull_request' && true || '' }}
69+
6870
with:
6971
os: ${{ matrix.os }}
7072
directory: ${{ matrix.directory }}

0 commit comments

Comments
 (0)