Skip to content

Commit d037034

Browse files
committed
Scope CLI integration tests to release workflow
1 parent 114caee commit d037034

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ jobs:
8686
[
8787
.agents,
8888
backend,
89-
cli,
9089
common,
9190
npm-app,
9291
packages/agent-runtime,
@@ -98,7 +97,6 @@ jobs:
9897
include:
9998
- package: .agents
10099
- package: backend
101-
- package: cli
102100
- package: common
103101
- package: npm-app
104102
- package: packages/agent-runtime
@@ -258,8 +256,6 @@ jobs:
258256
else
259257
echo "No integration tests found in .agents"
260258
fi
261-
elif [ "${{ matrix.package }}" = "cli" ]; then
262-
find src -name '*.integration.test.ts' | sort | xargs -I {} bun test --timeout=180000 {}
263259
else
264260
find src -name '*.integration.test.ts' | sort | xargs -I {} bun test --timeout=60000 {}
265261
fi

.github/workflows/cli-release-build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,43 @@ on:
2828
default: '{}'
2929

3030
jobs:
31+
cli-integration-tests:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
ref: ${{ inputs.checkout-ref || github.sha }}
37+
38+
- uses: ./.github/actions/setup-project
39+
40+
- name: Set environment variables
41+
env:
42+
SECRETS_CONTEXT: ${{ toJSON(secrets) }}
43+
ENV_OVERRIDES: ${{ inputs.env-overrides }}
44+
shell: bash
45+
run: |
46+
VAR_NAMES=$(bun scripts/generate-ci-env.ts --scope client)
47+
48+
echo "$SECRETS_CONTEXT" | jq -r --argjson vars "$VAR_NAMES" '
49+
to_entries | .[] | select(.key as $k | $vars | index($k)) | .key + "=" + .value
50+
' >> $GITHUB_ENV
51+
echo "CODEBUFF_GITHUB_ACTIONS=true" >> $GITHUB_ENV
52+
echo "NEXT_PUBLIC_CB_ENVIRONMENT=test" >> $GITHUB_ENV
53+
echo "CODEBUFF_GITHUB_TOKEN=${{ secrets.CODEBUFF_GITHUB_TOKEN }}" >> $GITHUB_ENV
54+
if [ "$ENV_OVERRIDES" != "{}" ]; then
55+
echo "$ENV_OVERRIDES" | jq -r 'to_entries | .[] | .key + "=" + .value' >> $GITHUB_ENV
56+
fi
57+
58+
- name: Build SDK before CLI integration tests
59+
run: cd sdk && bun run build
60+
61+
- name: Run CLI integration tests
62+
run: |
63+
cd cli
64+
find src -name '*.integration.test.ts' | sort | xargs -I {} bun test --timeout=180000 {}
65+
3166
build-binaries:
67+
needs: cli-integration-tests
3268
strategy:
3369
matrix:
3470
include:
@@ -197,6 +233,7 @@ jobs:
197233
path: ${{ inputs.binary-name }}-${{ matrix.target }}.tar.gz
198234

199235
build-windows-binary:
236+
needs: cli-integration-tests
200237
runs-on: windows-latest
201238
steps:
202239
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)