Skip to content

Commit b9460fb

Browse files
RobertCraigiestainless-app[bot]
authored andcommitted
CI: add ecosystem tests (#1332)
1 parent 13aab10 commit b9460fb

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

.github/workflows/ci.yml

+33
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,36 @@ jobs:
6464

6565
- name: Run tests
6666
run: ./scripts/test
67+
68+
ecosystem_tests:
69+
name: ecosystem tests (v${{ matrix.node-version }})
70+
runs-on: ubuntu-latest
71+
if: github.repository == 'openai/openai-node'
72+
timeout-minutes: 20
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
node-version: ['20']
77+
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Set up Node
82+
uses: actions/setup-node@v4
83+
with:
84+
node-version: '${{ matrix.node-version }}'
85+
86+
- uses: denoland/setup-deno@v1
87+
with:
88+
deno-version: v1.39.0
89+
90+
- uses: oven-sh/setup-bun@v2
91+
92+
- name: Bootstrap
93+
run: ./scripts/bootstrap
94+
95+
- name: Run ecosystem tests
96+
run: |
97+
yarn tsn ecosystem-tests/cli.ts --live --verbose --parallel --jobs=4 --retry=3
98+
env:
99+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ tmp
1111
.pack
1212
ecosystem-tests/deno/package.json
1313
ecosystem-tests/*/openai.tgz
14-
14+
.dev.vars

ecosystem-tests/cli.ts

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const projectRunners = {
7070
'cloudflare-worker': async () => {
7171
await installPackage();
7272

73+
await fs.writeFile('.dev.vars', `OPENAI_API_KEY='${process.env['OPENAI_API_KEY']}'`);
7374
await run('npm', ['run', 'tsc']);
7475

7576
if (state.live) {

0 commit comments

Comments
 (0)