diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..202a575 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + pull_request: + branches: + - master + +jobs: + check: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: 14 + - uses: actions/checkout@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn --prefer-offline --frozen-lockfile + - run: yarn run check + - run: yarn run build + - uses: ipfs/aegir/actions/bundle-size@master + name: Check bundle size + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + # ci: + # name: Build and Test + # strategy: + # matrix: + # node: [12, 14] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/setup-node@v1 + # with: + # node-version: ${{ matrix.node }} diff --git a/.travis.yml b/.travis.yml index 202b660..f12e4b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,7 @@ jobs: include: - stage: check script: - - yarn aegir dep-check - - npx aegir ts -p check + - yarn run check - yarn run lint - yarn run build diff --git a/package.json b/package.json index 4eec59e..b46948a 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,14 @@ "scripts": { "bench": "node benchmarks/benchmark.js", "clean": "rm -rf dist", + "check": "aegir dep-check && aegir ts -p check", "copy-dts": "copyup \"src/**/*.d.ts\" dist/src", "build": "aegir build", "postbuild": "yarn run copy-dts", "lint": "aegir lint", "lint:fix": "aegir lint --fix", - "test": "aegir ts -p check && aegir test", + "pretest": "yarm run check", + "test": "aegir test", "test:node": "aegir test -t node", "test:browser": "aegir test -t browser", "docs": "aegir docs", diff --git a/test/noise.spec.ts b/test/noise.spec.ts index ebc00dd..8027ad0 100644 --- a/test/noise.spec.ts +++ b/test/noise.spec.ts @@ -144,7 +144,9 @@ describe('Noise', () => { KeyCache.store(localPeer, staticKeysInitiator.publicKey) KeyCache.store(remotePeer, staticKeysResponder.publicKey) + // @ts-expect-error const xxSpy = sandbox.spy(noiseInit, 'performXXHandshake') + // @ts-expect-error const xxFallbackSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake') const [inboundConnection, outboundConnection] = DuplexPair() @@ -171,6 +173,7 @@ describe('Noise', () => { const staticKeysInitiator = generateKeypair() const noiseInit = new Noise(staticKeysInitiator.privateKey) const noiseResp = new Noise() + // @ts-expect-error const xxSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake') // Prepare key cache for noise pipes @@ -205,6 +208,7 @@ describe('Noise', () => { const staticKeysResponder = generateKeypair() const noiseResp = new Noise(staticKeysResponder.privateKey, undefined) + // @ts-expect-error const xxSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake') // Prepare key cache for noise pipes @@ -237,7 +241,9 @@ describe('Noise', () => { const staticKeysResponder = generateKeypair() const noiseResp = new Noise(staticKeysResponder.privateKey) + // @ts-expect-error const xxInitSpy = sandbox.spy(noiseInit, 'performXXHandshake') + // @ts-expect-error const xxRespSpy = sandbox.spy(noiseResp, 'performXXFallbackHandshake') // Prepare key cache for noise pipes @@ -271,8 +277,11 @@ describe('Noise', () => { const staticKeysResponder = generateKeypair() const noiseResp = new Noise(staticKeysResponder.privateKey) + // @ts-expect-error const ikInitSpy = sandbox.spy(noiseInit, 'performIKHandshake') + // @ts-expect-error const xxFallbackInitSpy = sandbox.spy(noiseInit, 'performXXFallbackHandshake') + // @ts-expect-error const ikRespSpy = sandbox.spy(noiseResp, 'performIKHandshake') // Prepare key cache for noise pipes