Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Python build tools
run: pip install build
- name: Install Python build and test tools
run: python3 -m pip install build pytest pytest-asyncio

- name: Build packages
run: pnpm run build
Expand Down Expand Up @@ -304,8 +304,8 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Python build tools
run: pip install build
- name: Install Python build and test tools
run: python3 -m pip install build pytest pytest-asyncio

- name: Show current version
run: |
Expand Down Expand Up @@ -425,8 +425,8 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Python build tools
run: pip install build
- name: Install Python build and test tools
run: python3 -m pip install build pytest pytest-asyncio

- name: Compute smoke version
id: smoke_version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Python build tools
run: pip install build
- name: Install Python build and test tools
run: python3 -m pip install build pytest pytest-asyncio

- name: Build packages
run: pnpm run build
Expand Down
47 changes: 47 additions & 0 deletions packages/sdk/scripts/__tests__/release-order.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ function assertOrder(content, first, second, context) {
assert.ok(firstIndex < secondIndex, `${context}: expected "${first}" before "${second}"`);
}

function sectionBetween(content, start, end, context) {
const startIndex = content.indexOf(start);
const endIndex = content.indexOf(end, startIndex + start.length);
assert.notEqual(startIndex, -1, `${context}: missing section start "${start}"`);
assert.notEqual(endIndex, -1, `${context}: missing section end "${end}"`);
return content.slice(startIndex, endIndex);
}

test('sdk-release.mjs builds Node SDK before validate', async () => {
const content = await readRepoFile('packages/sdk/scripts/sdk-release.mjs');
assertOrder(
Expand All @@ -39,6 +47,45 @@ test('release-sdk fallback workflow builds Node SDK before validate', async () =
assertOrder(content, '- name: Build Node SDK', '- name: Validate SDK', '.github/workflows/release-sdk.yml');
});

test('release workflows install Python SDK test dependencies before validation', async () => {
const installCommand = 'python3 -m pip install build pytest pytest-asyncio';

const releaseSdk = await readRepoFile('.github/workflows/release-sdk.yml');
const autoRelease = sectionBetween(
releaseSdk,
' auto-release:',
' sync-labs-agent:',
'.github/workflows/release-sdk.yml',
);
assertOrder(
autoRelease,
installCommand,
'- name: Run semantic-release',
'.github/workflows/release-sdk.yml auto-release',
);

const manualRelease = sectionBetween(
releaseSdk,
' manual-release:',
' testpypi-smoke:',
'.github/workflows/release-sdk.yml',
);
assertOrder(
manualRelease,
installCommand,
'- name: Validate SDK',
'.github/workflows/release-sdk.yml manual-release',
);

const stableRelease = await readRepoFile('.github/workflows/release-stable.yml');
assertOrder(
stableRelease,
installCommand,
'- name: Release stable packages (orchestrator)',
'.github/workflows/release-stable.yml',
);
});

test('release-sdk fallback workflow publishes Node SDK via sdk-release-publish', async () => {
const content = await readRepoFile('.github/workflows/release-sdk.yml');
const expectedCmd = 'node packages/sdk/scripts/sdk-release-publish.mjs --tag "${{ inputs.npm-tag }}" --npm-only';
Expand Down
Loading