mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-24 22:32:30 +00:00
add check job in ci
This commit is contained in:
parent
2038b26b76
commit
ef3ae768d0
46
.github/workflows/ci.yml
vendored
Normal file
46
.github/workflows/ci.yml
vendored
Normal file
@ -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 }}
|
@ -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
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user