Skip to content

Commit ef3ae76

Browse files
committed
add check job in ci
1 parent 2038b26 commit ef3ae76

File tree

4 files changed

+59
-3
lines changed

4 files changed

+59
-3
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
check:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 14
17+
- uses: actions/checkout@v2
18+
- name: Get yarn cache directory path
19+
id: yarn-cache-dir-path
20+
run: echo "::set-output name=dir::$(yarn cache dir)"
21+
- uses: actions/cache@v2
22+
id: yarn-cache
23+
with:
24+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
25+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-yarn-
28+
- run: yarn --prefer-offline --frozen-lockfile
29+
- run: yarn run check
30+
- run: yarn run build
31+
- uses: ipfs/aegir/actions/bundle-size@master
32+
name: Check bundle size
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
# ci:
37+
# name: Build and Test
38+
# strategy:
39+
# matrix:
40+
# node: [12, 14]
41+
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
42+
# runs-on: ${{ matrix.os }}
43+
# steps:
44+
# - uses: actions/setup-node@v1
45+
# with:
46+
# node-version: ${{ matrix.node }}

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ jobs:
2626
include:
2727
- stage: check
2828
script:
29-
- yarn aegir dep-check
30-
- npx aegir ts -p check
29+
- yarn run check
3130
- yarn run lint
3231
- yarn run build
3332

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
"scripts": {
2222
"bench": "node benchmarks/benchmark.js",
2323
"clean": "rm -rf dist",
24+
"check": "aegir dep-check && aegir ts -p check",
2425
"copy-dts": "copyup \"src/**/*.d.ts\" dist/src",
2526
"build": "aegir build",
2627
"postbuild": "yarn run copy-dts",
2728
"lint": "aegir lint",
2829
"lint:fix": "aegir lint --fix",
29-
"test": "aegir ts -p check && aegir test",
30+
"pretest": "yarm run check",
31+
"test": "aegir test",
3032
"test:node": "aegir test -t node",
3133
"test:browser": "aegir test -t browser",
3234
"docs": "aegir docs",

test/noise.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ describe('Noise', () => {
144144
KeyCache.store(localPeer, staticKeysInitiator.publicKey)
145145
KeyCache.store(remotePeer, staticKeysResponder.publicKey)
146146

147+
// @ts-expect-error
147148
const xxSpy = sandbox.spy(noiseInit, 'performXXHandshake')
149+
// @ts-expect-error
148150
const xxFallbackSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake')
149151

150152
const [inboundConnection, outboundConnection] = DuplexPair()
@@ -171,6 +173,7 @@ describe('Noise', () => {
171173
const staticKeysInitiator = generateKeypair()
172174
const noiseInit = new Noise(staticKeysInitiator.privateKey)
173175
const noiseResp = new Noise()
176+
// @ts-expect-error
174177
const xxSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake')
175178

176179
// Prepare key cache for noise pipes
@@ -205,6 +208,7 @@ describe('Noise', () => {
205208

206209
const staticKeysResponder = generateKeypair()
207210
const noiseResp = new Noise(staticKeysResponder.privateKey, undefined)
211+
// @ts-expect-error
208212
const xxSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake')
209213

210214
// Prepare key cache for noise pipes
@@ -237,7 +241,9 @@ describe('Noise', () => {
237241
const staticKeysResponder = generateKeypair()
238242

239243
const noiseResp = new Noise(staticKeysResponder.privateKey)
244+
// @ts-expect-error
240245
const xxInitSpy = sandbox.spy(noiseInit, 'performXXHandshake')
246+
// @ts-expect-error
241247
const xxRespSpy = sandbox.spy(noiseResp, 'performXXFallbackHandshake')
242248

243249
// Prepare key cache for noise pipes
@@ -271,8 +277,11 @@ describe('Noise', () => {
271277
const staticKeysResponder = generateKeypair()
272278

273279
const noiseResp = new Noise(staticKeysResponder.privateKey)
280+
// @ts-expect-error
274281
const ikInitSpy = sandbox.spy(noiseInit, 'performIKHandshake')
282+
// @ts-expect-error
275283
const xxFallbackInitSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake')
284+
// @ts-expect-error
276285
const ikRespSpy = sandbox.spy(noiseResp, 'performIKHandshake')
277286

278287
// Prepare key cache for noise pipes

0 commit comments

Comments
 (0)