99
1010jobs :
1111
12+ build :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v3
16+ - uses : actions/setup-node@v3
17+ with :
18+ node-version : lts/*
19+ - uses : ipfs/aegir/actions/cache-node-modules@master
20+
1221 check :
22+ needs : build
1323 runs-on : ubuntu-latest
1424 steps :
1525 - uses : actions/checkout@v3
@@ -21,12 +31,12 @@ jobs:
2131 - run : npm run --if-present dep-check
2232
2333 test-node :
24- needs : check
34+ needs : build
2535 runs-on : ${{ matrix.os }}
2636 strategy :
2737 matrix :
2838 os : [windows-latest, ubuntu-latest, macos-latest]
29- node : [16 ]
39+ node : [lts/* ]
3040 fail-fast : true
3141 steps :
3242 - uses : actions/checkout@v3
4151 flags : node
4252
4353 test-chrome :
44- needs : check
54+ needs : build
4555 runs-on : ubuntu-latest
4656 steps :
4757 - uses : actions/checkout@v3
5666 flags : chrome
5767
5868 test-chrome-webworker :
59- needs : check
69+ needs : build
6070 runs-on : ubuntu-latest
6171 steps :
6272 - uses : actions/checkout@v3
7181 flags : chrome-webworker
7282
7383 test-firefox :
74- needs : check
84+ needs : build
7585 runs-on : ubuntu-latest
7686 steps :
7787 - uses : actions/checkout@v3
8696 flags : firefox
8797
8898 test-firefox-webworker :
89- needs : check
99+ needs : build
90100 runs-on : ubuntu-latest
91101 steps :
92102 - uses : actions/checkout@v3
@@ -101,7 +111,7 @@ jobs:
101111 flags : firefox-webworker
102112
103113 test-webkit :
104- needs : check
114+ needs : build
105115 runs-on : ubuntu-latest
106116 steps :
107117 - uses : actions/checkout@v3
@@ -117,7 +127,7 @@ jobs:
117127 flags : webkit
118128
119129 test-electron-main :
120- needs : check
130+ needs : build
121131 runs-on : ubuntu-latest
122132 steps :
123133 - uses : actions/checkout@v3
@@ -132,7 +142,7 @@ jobs:
132142 flags : electron-main
133143
134144 test-electron-renderer :
135- needs : check
145+ needs : build
136146 runs-on : ubuntu-latest
137147 steps :
138148 - uses : actions/checkout@v3
@@ -147,7 +157,7 @@ jobs:
147157 flags : electron-renderer
148158
149159 test-interop :
150- needs : check
160+ needs : build
151161 runs-on : ubuntu-latest
152162 steps :
153163 - uses : actions/checkout@v3
@@ -157,6 +167,66 @@ jobs:
157167 - uses : ipfs/aegir/actions/cache-node-modules@master
158168 - run : npm run test:interop -- --bail
159169
170+ test-example :
171+ needs : build
172+ runs-on : ubuntu-latest
173+ strategy :
174+ matrix :
175+ example : [
176+ chat,
177+ connection-encryption,
178+ discovery-mechanisms,
179+ echo,
180+ libp2p-in-the-browser,
181+ peer-and-content-routing,
182+ pnet,
183+ protocol-and-stream-muxing,
184+ pubsub,
185+ transports
186+ ]
187+ fail-fast : true
188+ steps :
189+ - uses : actions/checkout@v3
190+ - uses : actions/setup-node@v3
191+ with :
192+ node-version : lts/*
193+ - uses : ipfs/aegir/actions/cache-node-modules@master
194+ with :
195+ directories : |
196+ ./examples/node_modules
197+ ~/.cache
198+ build : |
199+ cd examples
200+ npm i
201+ npx playwright install
202+ cache_name : cache-examples
203+ - run : |
204+ cd examples
205+ npm run test -- ${{ matrix.example }}
206+
207+ multidim-interop :
208+ needs : build
209+ runs-on : ubuntu-latest
210+ steps :
211+ - uses : actions/checkout@v3
212+ - uses : ipfs/aegir/actions/cache-node-modules@master
213+ - name : Build images
214+ run : (cd interop && make)
215+ - name : Save package-lock.json as artifact
216+ uses : actions/upload-artifact@v2
217+ with :
218+ name : package locks
219+ path : |
220+ package-lock.json
221+ interop/package-lock.json
222+ - uses : libp2p/test-plans/.github/actions/run-interop-ping-test@master
223+ with :
224+ test-filter : js-libp2p-head
225+ extra-versions : ${{ github.workspace }}/interop/node-version.json ${{ github.workspace }}/interop/chromium-version.json ${{ github.workspace }}/interop/firefox-version.json
226+ s3-cache-bucket : ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
227+ s3-access-key-id : ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
228+ s3-secret-access-key : ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
229+
160230 release :
161231 runs-on : ubuntu-latest
162232 needs : [
@@ -167,7 +237,9 @@ jobs:
167237 test-firefox-webworker,
168238 test-electron-main,
169239 test-electron-renderer,
170- test-interop
240+ test-interop,
241+ test-example,
242+ multidim-interop
171243 ]
172244 if : github.event_name == 'push' && github.ref == 'refs/heads/master'
173245 steps :
0 commit comments