File tree 5 files changed +162
-1
lines changed
5 files changed +162
-1
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,6 @@ jobs:
141
141
npm --prefix integration/${{ matrix.suite }} install "./${{ needs.build.outputs.tarball-name }}"
142
142
npm --prefix integration/${{ matrix.suite }} test
143
143
144
-
145
144
integration-bun :
146
145
needs : [test, build]
147
146
runs-on : ubuntu-latest
@@ -172,6 +171,33 @@ jobs:
172
171
bun test && break || echo "Test failed, retrying..."
173
172
done
174
173
174
+ integration-deno :
175
+ needs : [test, build]
176
+ runs-on : ubuntu-latest
177
+
178
+ env :
179
+ REPLICATE_API_TOKEN : ${{ secrets.REPLICATE_API_TOKEN }}
180
+
181
+ strategy :
182
+ matrix :
183
+ deno-version : [v1.x]
184
+ suite : [deno]
185
+
186
+ steps :
187
+ - uses : actions/checkout@v4
188
+ - uses : actions/download-artifact@v3
189
+ with :
190
+ name : package-tarball
191
+ - name : Use Deno ${{ matrix.deno-version }}
192
+ uses : denoland/setup-deno@v1
193
+ with :
194
+ deno-version : ${{ matrix.deno-version }}
195
+ - run : |
196
+ cd integration/deno
197
+ deno cache --node-modules-dir index.ts
198
+ tar -xzf ../../${{ needs.build.outputs.tarball-name }} --strip-components=1 -C node_modules/replicate
199
+ deno test --allow-env --allow-net --node-modules-dir index.test.ts
200
+
175
201
integration-nextjs :
176
202
needs : [test, build]
177
203
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change
1
+ {
2
+ "imports" : {
3
+ "replicate" : " npm:replicate"
4
+ }
5
+ }
Original file line number Diff line number Diff line change
1
+ import { assertEquals } from "jsr:@std/assert" ;
2
+ import main from "./index.ts" ;
3
+
4
+ // Verify exported types.
5
+ import type {
6
+ Status ,
7
+ Visibility ,
8
+ WebhookEventType ,
9
+ ApiError ,
10
+ Collection ,
11
+ Hardware ,
12
+ Model ,
13
+ ModelVersion ,
14
+ Prediction ,
15
+ Training ,
16
+ Page ,
17
+ ServerSentEvent ,
18
+ } from "replicate" ;
19
+
20
+ Deno . test ( {
21
+ name : "main" ,
22
+ async fn ( ) {
23
+ const output = await main ( ) ;
24
+ assertEquals ( { output } , { output : "hello Deno the dinosaur" } ) ;
25
+ } ,
26
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import Replicate from "replicate" ;
2
+
3
+ const replicate = new Replicate ( {
4
+ auth : Deno . env . get ( "REPLICATE_API_TOKEN" ) ,
5
+ } ) ;
6
+
7
+ export default async function main ( ) {
8
+ return await replicate . run (
9
+ "replicate/hello-world:5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa" ,
10
+ {
11
+ input : {
12
+ text : "Deno the dinosaur" ,
13
+ } ,
14
+ }
15
+ ) ;
16
+ }
You can’t perform that action at this time.
0 commit comments