ci: install pinned image test dependency
All checks were successful
Quality gates / quality (pull_request) Successful in 1m12s

This commit is contained in:
Timmy 2026-08-19 08:14:43 +00:00
parent 29ba8594b8
commit 47eec47a31
3 changed files with 12 additions and 1 deletions

View File

@ -24,7 +24,9 @@ jobs:
node-version: 22 node-version: 22
cache: npm cache: npm
- name: Install reproducibly - name: Install reproducibly
run: npm ci run: |
npm ci
python3 -m pip install --break-system-packages -r requirements-test.txt
- name: Install browser - name: Install browser
run: npx playwright install --with-deps chromium run: npx playwright install --with-deps chromium
- name: Unit and security tests - name: Unit and security tests

1
requirements-test.txt Normal file
View File

@ -0,0 +1 @@
Pillow==12.3.0

View File

@ -4,6 +4,7 @@ import { readFile } from 'node:fs/promises';
const workflowPath = new URL('../.gitea/workflows/quality.yml', import.meta.url); const workflowPath = new URL('../.gitea/workflows/quality.yml', import.meta.url);
const diffCheckPath = new URL('../scripts/check_diff.sh', import.meta.url); const diffCheckPath = new URL('../scripts/check_diff.sh', import.meta.url);
const pythonRequirementsPath = new URL('../requirements-test.txt', import.meta.url);
test('Gitea CI gates pull requests and main with the reproducible quality suite', async () => { test('Gitea CI gates pull requests and main with the reproducible quality suite', async () => {
const workflow = await readFile(workflowPath, 'utf8'); const workflow = await readFile(workflowPath, 'utf8');
@ -14,6 +15,7 @@ test('Gitea CI gates pull requests and main with the reproducible quality suite'
assert.match(workflow, /^ timeout-minutes: 15$/m); assert.match(workflow, /^ timeout-minutes: 15$/m);
assert.match(workflow, /fetch-depth: 0/); assert.match(workflow, /fetch-depth: 0/);
assert.match(workflow, /npm ci/); assert.match(workflow, /npm ci/);
assert.match(workflow, /python3 -m pip install --break-system-packages -r requirements-test\.txt/);
assert.match(workflow, /npm test/); assert.match(workflow, /npm test/);
assert.match(workflow, /npm run test:ui/); assert.match(workflow, /npm run test:ui/);
assert.match(workflow, /npm run test:photo/); assert.match(workflow, /npm run test:photo/);
@ -22,6 +24,12 @@ test('Gitea CI gates pull requests and main with the reproducible quality suite'
assert.match(workflow, /npm run check:diff/); assert.match(workflow, /npm run check:diff/);
}); });
test('CI pins the Python image dependency required by the full unit suite', async () => {
const requirements = await readFile(pythonRequirementsPath, 'utf8');
assert.match(requirements, /^Pillow==12\.3\.0$/m);
});
test('diff hygiene checks only the pull request or latest commit range', async () => { test('diff hygiene checks only the pull request or latest commit range', async () => {
const script = await readFile(diffCheckPath, 'utf8'); const script = await readFile(diffCheckPath, 'utf8');