Cache npm downloads in Gitea workflows
This commit is contained in:
@@ -219,5 +219,16 @@ assert(!workflowText.includes('secrets.'), 'CMS pull-request validation must rem
|
||||
for (const command of ['npm run verify:cms', 'SITE_KEY=www npm run build:site', 'SITE_KEY=www npm run verify:build', 'SITE_KEY=blog npm run build:site', 'SITE_KEY=blog npm run verify:build']) {
|
||||
assert(workflowText.includes(command), `Validation workflow is missing: ${command}`);
|
||||
}
|
||||
for (const path of [
|
||||
'.gitea/workflows/cms-content-validation.yml',
|
||||
'.gitea/workflows/deploy.yml',
|
||||
'.gitea/workflows/deploy-blog.yml',
|
||||
'.gitea/workflows/production-candidate.yml',
|
||||
'.gitea/workflows/production-blog.yml',
|
||||
]) {
|
||||
const text = await readFile(path, 'utf8');
|
||||
assert(/cache:\s*npm/.test(text) && /cache-dependency-path:\s*package-lock\.json/.test(text), `${path} must cache npm downloads by package-lock.json.`);
|
||||
assert(text.includes('npm ci --prefer-offline --no-audit --no-fund'), `${path} must retain a clean lockfile install while preferring the cache.`);
|
||||
}
|
||||
|
||||
console.log('Verified Decap backend, four content contracts, fixed page images, bounded media, admin pin, and stable PR status context.');
|
||||
|
||||
Reference in New Issue
Block a user