28
28
- run : npm run lint
29
29
30
30
31
+ # Build a production tarball and use it to run the integration
32
+ build :
33
+ runs-on : ubuntu-latest
34
+
35
+ outputs :
36
+ tarball-name : ${{ steps.pack.outputs.tarball-name }}
37
+
38
+ steps :
39
+ - uses : actions/checkout@v3
40
+ - name : Use Node.js
41
+ uses : actions/setup-node@v3
42
+ with :
43
+ node-version : 20.x
44
+ cache : " npm"
45
+ - name : Build tarball
46
+ id : pack
47
+ run : |
48
+ echo "tarball-name=$(npm --loglevel error pack)" >> $GITHUB_OUTPUT
49
+ - uses : actions/upload-artifact@v3
50
+ with :
51
+ name : package-tarball
52
+ path : ${{ steps.pack.outputs.tarball-name }}
53
+
54
+
31
55
integration-node :
32
- needs : test
56
+ needs : [ test, build]
33
57
runs-on : ubuntu-latest
34
58
35
59
env :
@@ -47,21 +71,22 @@ jobs:
47
71
48
72
steps :
49
73
- uses : actions/checkout@v3
74
+ - uses : actions/download-artifact@v3
75
+ with :
76
+ name : package-tarball
50
77
- name : Use Node.js ${{ matrix.node-version }}
51
78
uses : actions/setup-node@v3
52
79
with :
53
80
node-version : ${{ matrix.node-version }}
54
81
cache : " npm"
55
- # Build a production tarball and run the integration tests against it.
56
82
- run : |
57
- PKG_TARBALL=$(npm --loglevel error pack)
58
83
npm --prefix integration/${{ matrix.suite }} install
59
- npm --prefix integration/${{ matrix.suite }} install "file:/ ./$PKG_TARBALL "
84
+ npm --prefix integration/${{ matrix.suite }} install "./${{ needs.build.outputs.tarball-name }} "
60
85
npm --prefix integration/${{ matrix.suite }} test
61
86
62
87
63
88
integration-edge :
64
- needs : test
89
+ needs : [ test, build]
65
90
runs-on : ubuntu-latest
66
91
67
92
env :
@@ -74,22 +99,23 @@ jobs:
74
99
75
100
steps :
76
101
- uses : actions/checkout@v3
102
+ - uses : actions/download-artifact@v3
103
+ with :
104
+ name : package-tarball
77
105
- name : Use Node.js ${{ matrix.node-version }}
78
106
uses : actions/setup-node@v3
79
107
with :
80
108
node-version : ${{ matrix.node-version }}
81
109
cache : " npm"
82
- # Build a production tarball and run the integration tests against it.
83
110
- run : |
84
111
test "${{ matrix.suite }}" = "cloudflare-worker" && echo "REPLICATE_API_TOKEN=${{ secrets.REPLICATE_API_TOKEN }}" > integration/${{ matrix.suite }}/.dev.vars
85
- PKG_TARBALL=$(npm --loglevel error pack)
86
112
npm --prefix integration/${{ matrix.suite }} install
87
- npm --prefix integration/${{ matrix.suite }} install "file:/ ./$PKG_TARBALL "
113
+ npm --prefix integration/${{ matrix.suite }} install "./${{ needs.build.outputs.tarball-name }} "
88
114
npm --prefix integration/${{ matrix.suite }} test
89
115
90
116
91
117
integration-bun :
92
- needs : test
118
+ needs : [ test, build]
93
119
runs-on : ubuntu-latest
94
120
95
121
env :
@@ -98,23 +124,19 @@ jobs:
98
124
strategy :
99
125
matrix :
100
126
bun-version : [1.0.11]
101
- node-version : [20.x]
102
127
suite : [bun]
103
128
104
129
steps :
105
130
- uses : actions/checkout@v3
106
- - name : Use Node.js ${{ matrix.node-version }}
107
- uses : actions/setup-node@v3
131
+ - uses : actions/download-artifact@v3
108
132
with :
109
- node-version : ${{ matrix.node-version }}
110
- cache : " npm"
133
+ name : package-tarball
111
134
- name : Use Bun ${{ matrix.bun-version }}
112
135
uses : oven-sh/setup-bun@v1
113
136
with :
114
137
bun-version : ${{ matrix.bun-version }}
115
138
- run : |
116
- PKG_TARBALL=$(npm --loglevel error pack)
117
139
cd integration/${{ matrix.suite }}
118
140
bun uninstall replicate
119
- bun install "file:../../$PKG_TARBALL "
141
+ bun install "file:../../${{ needs.build.outputs.tarball-name }} "
120
142
bun test
0 commit comments