add check job in ci

This commit is contained in:
Marin Petrunić 2021-01-27 11:39:54 +01:00
parent 2038b26b76
commit ef3ae768d0
No known key found for this signature in database
GPG Key ID: 834D07135E110DA5
4 changed files with 59 additions and 3 deletions

46
.github/workflows/ci.yml vendored Normal file
View 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 }}

View File

@ -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

View File

@ -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",

View File

@ -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