mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-21 14:46:19 +00:00
fix(ci): avoid root-owned npm cache workspace files (#8669)
This commit is contained in:
parent
6897ef7440
commit
5fdcdb28e2
3 changed files with 14 additions and 7 deletions
17
.github/scripts/qwen-triage-workflow.test.mjs
vendored
17
.github/scripts/qwen-triage-workflow.test.mjs
vendored
|
|
@ -755,8 +755,8 @@ describe('qwen-triage: npm cache producer workflow', () => {
|
|||
it('runs on the same target as the consumers so the cache version matches', () => {
|
||||
// actions/cache scopes an entry by a hash of the literal cache path plus
|
||||
// the compression method. A producer on a different runner or outside the
|
||||
// container computes a different version, so every restore misses even
|
||||
// when the key and path strings match — pin runs-on + container to the
|
||||
// container image computes a different version, so every restore misses
|
||||
// even when the key and path strings match — pin runs-on + image to the
|
||||
// consumers' so both match by construction.
|
||||
for (const [jobName, jobDef] of [
|
||||
['verify', verifyJob],
|
||||
|
|
@ -767,11 +767,16 @@ describe('qwen-triage: npm cache producer workflow', () => {
|
|||
jobDef['runs-on'],
|
||||
`producer runs-on must match ${jobName}`,
|
||||
);
|
||||
assert.deepEqual(
|
||||
saveJob.container,
|
||||
jobDef.container,
|
||||
`producer container must match ${jobName}`,
|
||||
assert.equal(
|
||||
saveJob.container.image,
|
||||
jobDef.container.image,
|
||||
`producer container image must match ${jobName}`,
|
||||
);
|
||||
}
|
||||
assert.equal(
|
||||
saveJob.container.options,
|
||||
'--init --user node',
|
||||
'producer must not leave root-owned files on the self-hosted runner',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
3
.github/workflows/npm-cache.yml
vendored
3
.github/workflows/npm-cache.yml
vendored
|
|
@ -30,7 +30,8 @@ jobs:
|
|||
runs-on: ['self-hosted', 'linux', 'x64', 'ecs-qwen']
|
||||
container:
|
||||
image: 'node:22-bookworm'
|
||||
options: '--init'
|
||||
# Match the host runner UID/GID so bind-mounted files stay writable.
|
||||
options: '--init --user node'
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6.0.3
|
||||
|
|
|
|||
|
|
@ -5370,6 +5370,7 @@ describe('qwen-triage npm cache producer', () => {
|
|||
"runs-on: ['self-hosted', 'linux', 'x64', 'ecs-qwen']",
|
||||
);
|
||||
expect(cacheProducerWorkflow).toContain("image: 'node:22-bookworm'");
|
||||
expect(cacheProducerWorkflow).toContain("options: '--init --user node'");
|
||||
for (const jobName of ['verify', 'tmux-testing']) {
|
||||
expect(job(jobName)).toContain(
|
||||
"runs-on: ['self-hosted', 'linux', 'x64', 'ecs-qwen']",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue