修复 CI 契约检查与原生依赖锁
改用量词表达工作流缩进正则以通过 ESLint。 补齐 AGC shared-contracts 的 sha2 锁依赖。
This commit is contained in:
+1
@@ -4570,6 +4570,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -44,7 +44,7 @@ function jobSection(jobName: (typeof jobNames)[number]) {
|
||||
|
||||
const nextJobOffset = workflow
|
||||
.slice(jobStart + 1)
|
||||
.search(/^ [a-z][a-z0-9-]+:$/m);
|
||||
.search(/^ {2}[a-z][a-z0-9-]+:$/m);
|
||||
return workflow.slice(
|
||||
jobStart,
|
||||
nextJobOffset < 0 ? undefined : jobStart + 1 + nextJobOffset,
|
||||
@@ -56,7 +56,7 @@ function stepSection(jobName: (typeof jobNames)[number], stepName: string) {
|
||||
const stepStart = job.indexOf(` - name: ${stepName}`);
|
||||
expect(stepStart).toBeGreaterThanOrEqual(0);
|
||||
|
||||
const nextStepOffset = job.slice(stepStart + 1).search(/^ - name: /m);
|
||||
const nextStepOffset = job.slice(stepStart + 1).search(/^ {6}- name: /m);
|
||||
return job.slice(
|
||||
stepStart,
|
||||
nextStepOffset < 0 ? undefined : stepStart + 1 + nextStepOffset,
|
||||
@@ -76,7 +76,7 @@ function backendStepIndex(stepName: string) {
|
||||
|
||||
describe('project CI workflow', () => {
|
||||
it('keeps every job on the isolated preinstalled CI image boundary', () => {
|
||||
expect(workflow.match(/^ runs-on: genarrative-ci$/gm)).toHaveLength(4);
|
||||
expect(workflow.match(/^ {4}runs-on: genarrative-ci$/gm)).toHaveLength(4);
|
||||
expect(workflow).not.toContain('actions/checkout');
|
||||
expect(workflow).not.toContain('actions/setup-node');
|
||||
expect(workflow).not.toMatch(/^\s+run: .*\b(?:apt|rustup)\b/m);
|
||||
|
||||
Reference in New Issue
Block a user