-
Notifications
You must be signed in to change notification settings - Fork 0
ci(actions): bound runner concurrency and Vitest workers #341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
747e499
ci(test): bound Vitest workers on hosted runners
seonghobae e73c549
test(ci): guard Vitest worker budget
seonghobae e26d8e3
ci(actions): bound superseded pull request runs
seonghobae 23bb1b6
fix(ci): keep explicit reruns from cancelling newer PR validation
seonghobae 58b1812
test(ci): cover rerun-safe workflow concurrency
seonghobae c197362
test(ci): run workflow concurrency contract in npm test
seonghobae 04339f9
test(ci): pin Vitest production test scope
seonghobae 756de7b
test(release): align retry contract with non-cancelling builds
seonghobae 96ecdbe
docs(release): document non-cancelling release concurrency
seonghobae b6868c7
fix(release): align Windows artifact directory contract
seonghobae 0f4c20b
fix(actions): cancel superseded PR release builds
seonghobae bbe5cc2
fix(actions): preserve explicit release reruns
seonghobae 07670d6
chore(merge): forward-merge main into vitest-worker-budget
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import assert from "node:assert/strict"; | ||
| import { readFileSync } from "node:fs"; | ||
| import test from "node:test"; | ||
|
|
||
| const workflow = (name) => readFileSync(new URL(`../../.github/workflows/${name}`, import.meta.url), "utf8"); | ||
|
|
||
| test("PR validation cancels only superseded first-attempt heads from the same repository PR", () => { | ||
| const source = workflow("test.yml"); | ||
| assert.match(source, /group: \$\{\{ github\.workflow \}\}-\$\{\{ github\.repository \}\}-\$\{\{ github\.event\.pull_request\.number \|\| github\.run_id \}\}/); | ||
| assert.match(source, /cancel-in-progress: \$\{\{ github\.event_name == 'pull_request' && github\.run_attempt == 1 \}\}/); | ||
| }); | ||
|
|
||
| test("release validation cancels only superseded first-attempt runs from the same pull request", () => { | ||
| const source = workflow("release.yml"); | ||
| assert.match(source, /group: \$\{\{ github\.workflow \}\}-\$\{\{ github\.repository \}\}-\$\{\{ github\.event\.pull_request\.number \|\| github\.run_id \}\}/); | ||
| assert.match(source, /cancel-in-progress: \$\{\{ github\.event_name == 'pull_request' && github\.run_attempt == 1 \}\}/); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { readFileSync } from 'node:fs'; | ||
| import { dirname, resolve } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..'); | ||
|
|
||
| /** Read the Vitest configuration with stable line endings for worker-budget assertions. */ | ||
| function readVitestConfig(): string { | ||
| return readFileSync(resolve(repositoryRoot, 'vitest.config.ts'), 'utf8').replace(/\r\n?/g, '\n'); | ||
| } | ||
|
|
||
| describe('Vitest hosted-runner worker budget', () => { | ||
| it('bounds CI worker concurrency without disabling file isolation or test files', () => { | ||
| const config = readVitestConfig(); | ||
|
|
||
| expect(config).toContain('maxWorkers: process.env.CI ? 2 : undefined'); | ||
| expect(config).toContain('include: ["src/**/*.test.ts"]'); | ||
| expect(config).not.toContain('fileParallelism: false'); | ||
| expect(config).not.toContain('pool: "threads"'); | ||
| expect(config).not.toContain("pool: 'threads'"); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.