Skip to content

Commit b2b2db3

Browse files
committed
ci: add unified SDK tests workflow with staging
1 parent 81a275d commit b2b2db3

File tree

4 files changed

+94
-9
lines changed

4 files changed

+94
-9
lines changed

.github/workflows/cli_tests.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Test CLI
22

33
on:
44
workflow_call:
5+
inputs:
6+
E2B_DOMAIN:
7+
required: false
8+
type: string
9+
default: ''
510
secrets:
611
E2B_API_KEY:
712
required: true
8-
pull_request:
9-
branches:
10-
- main
1113

1214
permissions:
1315
contents: read
@@ -62,8 +64,16 @@ jobs:
6264
run: pnpm build
6365
working-directory: ./packages/cli
6466

67+
- name: Debug E2B_DOMAIN
68+
run: |
69+
echo "inputs.E2B_DOMAIN=${{ inputs.E2B_DOMAIN }}"
70+
echo "E2B_DOMAIN=${E2B_DOMAIN:-(not set)}"
71+
env:
72+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
73+
6574
- name: Run tests
6675
run: pnpm test
6776
working-directory: ./packages/cli
6877
env:
6978
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
79+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}

.github/workflows/js_sdk_tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Test JS SDK
22

33
on:
44
workflow_call:
5+
inputs:
6+
E2B_DOMAIN:
7+
required: false
8+
type: string
9+
default: ''
510
secrets:
611
E2B_API_KEY:
712
required: true
8-
pull_request:
9-
branches:
10-
- main
1113

1214
permissions:
1315
contents: read
@@ -76,13 +78,21 @@ jobs:
7678
restore-keys: |
7779
playwright-${{ runner.os }}-${{ env.TOOL_VERSION_NODEJS }}-
7880
81+
- name: Debug E2B_DOMAIN
82+
run: |
83+
echo "inputs.E2B_DOMAIN=${{ inputs.E2B_DOMAIN }}"
84+
echo "E2B_DOMAIN=${E2B_DOMAIN:-(not set)}"
85+
env:
86+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
87+
7988
- name: Test build
8089
run: pnpm build
8190

8291
- name: Run Node tests
8392
run: pnpm test
8493
env:
8594
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
95+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
8696

8797
- name: Install Bun
8898
uses: oven-sh/setup-bun@v2
@@ -91,6 +101,7 @@ jobs:
91101
run: pnpm test:bun
92102
env:
93103
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
104+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
94105

95106
- name: Install Deno
96107
uses: denoland/setup-deno@v1
@@ -101,3 +112,4 @@ jobs:
101112
run: pnpm test:deno
102113
env:
103114
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
115+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}

.github/workflows/python_sdk_tests.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Test Python SDK
22

33
on:
44
workflow_call:
5+
inputs:
6+
E2B_DOMAIN:
7+
required: false
8+
type: string
9+
default: ''
510
secrets:
611
E2B_API_KEY:
712
required: true
8-
pull_request:
9-
branches:
10-
- main
1113

1214
permissions:
1315
contents: read
@@ -51,10 +53,18 @@ jobs:
5153
- name: Install dependencies
5254
run: poetry install
5355

56+
- name: Debug E2B_DOMAIN
57+
run: |
58+
echo "inputs.E2B_DOMAIN=${{ inputs.E2B_DOMAIN }}"
59+
echo "E2B_DOMAIN=${E2B_DOMAIN:-(not set)}"
60+
env:
61+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
62+
5463
- name: Test build
5564
run: poetry build
5665

5766
- name: Run tests
5867
run: poetry run pytest --verbose --numprocesses=4
5968
env:
6069
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
70+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}

.github/workflows/sdk_tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: SDK Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
js-tests:
14+
name: Production / JS SDK Tests
15+
uses: ./.github/workflows/js_sdk_tests.yml
16+
secrets:
17+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
18+
19+
python-tests:
20+
name: Production / Python SDK Tests
21+
uses: ./.github/workflows/python_sdk_tests.yml
22+
secrets:
23+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
24+
25+
cli-tests:
26+
name: Production / CLI Tests
27+
uses: ./.github/workflows/cli_tests.yml
28+
secrets:
29+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
30+
31+
js-tests-staging:
32+
name: Staging / JS SDK Tests
33+
uses: ./.github/workflows/js_sdk_tests.yml
34+
with:
35+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
36+
secrets:
37+
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}
38+
39+
python-tests-staging:
40+
name: Staging / Python SDK Tests
41+
uses: ./.github/workflows/python_sdk_tests.yml
42+
with:
43+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
44+
secrets:
45+
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}
46+
47+
cli-tests-staging:
48+
name: Staging / CLI Tests
49+
uses: ./.github/workflows/cli_tests.yml
50+
with:
51+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
52+
secrets:
53+
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

0 commit comments

Comments
 (0)