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
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
0 commit comments