Skip to content

Commit 3fb4249

Browse files
authoredNov 19, 2021
chore: fix examples (#1026)
Uses npm to install deps for examples. We can put yarn back when we remove `node-fetch@2.x` from ipfs-utils, or when yarn can download tarball dependencies reliably. This either needs: 1. node-fetch/node-fetch#1172 merging 2. Swap node-fetch for undici 3. Drop CJS support (node-fetch 3 has the above fix but is ESM-only)
1 parent bb0ca28 commit 3fb4249

File tree

1 file changed

+52
-13
lines changed

1 file changed

+52
-13
lines changed
 

‎.github/workflows/examples.yml

+52-13
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
1518
- run: npm install
1619
- run: npx aegir lint
1720
- run: npx aegir ts -p check
@@ -21,82 +24,118 @@ jobs:
2124
runs-on: ubuntu-latest
2225
steps:
2326
- uses: actions/checkout@v2
27+
- uses: actions/setup-node@v2
28+
with:
29+
node-version: 16
2430
- run: npm install
25-
- run: cd examples && yarn && npm run test -- auto-relay
31+
- run: cd examples && npm i && npm run test -- auto-relay
2632
test-chat-example:
2733
needs: check
2834
runs-on: ubuntu-latest
2935
steps:
3036
- uses: actions/checkout@v2
37+
- uses: actions/setup-node@v2
38+
with:
39+
node-version: 16
3140
- run: npm install
32-
- run: cd examples && yarn && npm run test -- chat
41+
- run: cd examples && npm i && npm run test -- chat
3342
test-connection-encryption-example:
3443
needs: check
3544
runs-on: ubuntu-latest
3645
steps:
3746
- uses: actions/checkout@v2
47+
- uses: actions/setup-node@v2
48+
with:
49+
node-version: 16
3850
- run: npm install
39-
- run: cd examples && yarn && npm run test -- connection-encryption
51+
- run: cd examples && npm i && npm run test -- connection-encryption
4052
test-discovery-mechanisms-example:
4153
needs: check
4254
runs-on: macos-latest
4355
steps:
4456
- uses: actions/checkout@v2
57+
- uses: actions/setup-node@v2
58+
with:
59+
node-version: 16
4560
- run: npm install
46-
- run: cd examples && yarn && npm run test -- discovery-mechanisms
61+
- run: cd examples && npm i && npm run test -- discovery-mechanisms
4762
test-echo-example:
4863
needs: check
4964
runs-on: ubuntu-latest
5065
steps:
5166
- uses: actions/checkout@v2
67+
- uses: actions/setup-node@v2
68+
with:
69+
node-version: 16
5270
- run: npm install
53-
- run: cd examples && yarn && npm run test -- echo
71+
- run: cd examples && npm i && npm run test -- echo
5472
test-libp2p-in-the-browser-example:
5573
needs: check
5674
runs-on: macos-latest
5775
steps:
5876
- uses: actions/checkout@v2
77+
- uses: actions/setup-node@v2
78+
with:
79+
node-version: 16
5980
- run: npm install
60-
- run: cd examples && yarn && npm run test -- libp2p-in-the-browser
81+
- run: cd examples && npm i && npm run test -- libp2p-in-the-browser
6182
test-peer-and-content-routing-example:
6283
needs: check
6384
runs-on: ubuntu-latest
6485
steps:
6586
- uses: actions/checkout@v2
87+
- uses: actions/setup-node@v2
88+
with:
89+
node-version: 16
6690
- run: npm install
67-
- run: cd examples && yarn && npm run test -- peer-and-content-routing
91+
- run: cd examples && npm i && npm run test -- peer-and-content-routing
6892
test-pnet-example:
6993
needs: check
7094
runs-on: ubuntu-latest
7195
steps:
7296
- uses: actions/checkout@v2
97+
- uses: actions/setup-node@v2
98+
with:
99+
node-version: 16
73100
- run: npm install
74-
- run: cd examples && yarn && npm run test -- pnet
101+
- run: cd examples && npm i && npm run test -- pnet
75102
test-protocol-and-stream-muxing-example:
76103
needs: check
77104
runs-on: ubuntu-latest
78105
steps:
79106
- uses: actions/checkout@v2
107+
- uses: actions/setup-node@v2
108+
with:
109+
node-version: 16
80110
- run: npm install
81-
- run: cd examples && yarn && npm run test -- protocol-and-stream-muxing
111+
- run: cd examples && npm i && npm run test -- protocol-and-stream-muxing
82112
test-pubsub-example:
83113
needs: check
84114
runs-on: ubuntu-latest
85115
steps:
86116
- uses: actions/checkout@v2
117+
- uses: actions/setup-node@v2
118+
with:
119+
node-version: 16
87120
- run: npm install
88-
- run: cd examples && yarn && npm run test -- pubsub
121+
- run: cd examples && npm i && npm run test -- pubsub
89122
test-transports-example:
90123
needs: check
91124
runs-on: ubuntu-latest
92125
steps:
93126
- uses: actions/checkout@v2
127+
- uses: actions/setup-node@v2
128+
with:
129+
node-version: 16
94130
- run: npm install
95-
- run: cd examples && yarn && npm run test -- transports
131+
- run: cd examples && npm i && npm run test -- transports
96132
test-webrtc-direct-example:
97133
needs: check
98134
runs-on: ubuntu-latest
99135
steps:
100136
- uses: actions/checkout@v2
101-
- run: npm install
102-
- run: cd examples && yarn && npm run test -- webrtc-direct
137+
- uses: actions/setup-node@v2
138+
with:
139+
node-version: 16
140+
- run: npm install -g @mapbox/node-pre-gyp && npm install
141+
- run: cd examples && npm i && npm run test -- webrtc-direct

0 commit comments

Comments
 (0)
Please sign in to comment.