Skip to content

Commit 3dc97bd

Browse files
committed
chore: update ci commands and benchmarks
1 parent 4fca780 commit 3dc97bd

File tree

3 files changed

+11
-34
lines changed

3 files changed

+11
-34
lines changed

.github/workflows/ci.yml

+5-29
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
restore-keys: |
5656
${{ runner.os }}-yarn-
5757
- run: yarn --prefer-offline --frozen-lockfile
58-
- run: npx aegir test -t node --bail --cov
58+
- run: npm run test:node -- --bail --cov
5959
- uses: codecov/codecov-action@v1
6060

6161
test-chrome:
@@ -78,7 +78,7 @@ jobs:
7878
restore-keys: |
7979
${{ runner.os }}-yarn-
8080
- run: yarn --prefer-offline --frozen-lockfile
81-
- run: npx aegir test -t browser -t webworker --bail
81+
- run: npm run test:browser -- --bail
8282

8383
test-firefox:
8484
name: Test Firefox
@@ -100,7 +100,7 @@ jobs:
100100
restore-keys: |
101101
${{ runner.os }}-yarn-
102102
- run: yarn --prefer-offline --frozen-lockfile
103-
- run: npx aegir test -t browser -t webworker --bail -- --browser firefox
103+
- run: npm run test:browser -- --bail -- --browser firefox
104104

105105
test-webkit:
106106
name: Test Webkit
@@ -123,7 +123,7 @@ jobs:
123123
restore-keys: |
124124
${{ runner.os }}-yarn-
125125
- run: yarn --prefer-offline --frozen-lockfile
126-
- run: npx aegir test -t browser -t webworker --bail -- --browser webkit
126+
- run: npm run test:browser -- --bail -- --browser webkit
127127

128128
test-electron-main:
129129
name: Test Electron Main
@@ -145,28 +145,4 @@ jobs:
145145
restore-keys: |
146146
${{ runner.os }}-yarn-
147147
- run: yarn --prefer-offline --frozen-lockfile
148-
- run: npx xvfb-maybe aegir test -t electron-main --bail
149-
150-
test-electron-renderer:
151-
name: Test Electron Renderer
152-
needs: check
153-
runs-on: ubuntu-latest
154-
steps:
155-
- uses: actions/setup-node@v2
156-
with:
157-
node-version: 16
158-
- uses: actions/checkout@v2
159-
- name: Get yarn cache directory path
160-
id: yarn-cache-dir-path
161-
run: echo "::set-output name=dir::$(yarn cache dir)"
162-
- uses: actions/cache@v2
163-
id: yarn-cache
164-
with:
165-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
166-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
167-
restore-keys: |
168-
${{ runner.os }}-yarn-
169-
- run: yarn --prefer-offline --frozen-lockfile
170-
- run: npx xvfb-maybe aegir test -t electron-renderer --bail
171-
env:
172-
ESBUILD_WORKER_THREADS: 0
148+
- run: npm run test:electron-main -- --bail

benchmarks/benchmark.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-disable */
22

3-
const { Noise } = require('../dist/src/index')
4-
const benchmark = require('benchmark')
5-
const { duplexPair } = require('it-pair/duplex')
6-
const { createFromJSON } = require('@libp2p/peer-id-factory')
3+
import { Noise } from '../dist/src/index.js'
4+
import benchmark from 'benchmark'
5+
import { duplexPair } from 'it-pair/duplex'
6+
import { createFromJSON } from '@libp2p/peer-id-factory'
77

88
const bench = async function () {
99
console.log('Initializing handshake benchmark')

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"pretest": "yarn run check",
3535
"test": "aegir test -f \"./dist/test/**/*.spec.js\"",
3636
"test:node": "npm run test -- -t node",
37-
"test:browser": "npm run test -- -t browser",
37+
"test:browser": "npm run test -- -t browser -t webworker",
38+
"test:electron-main": "npm run test -- -t electron-main",
3839
"docs": "aegir docs",
3940
"proto:gen": "pbjs -t static-module -w es6 -r libp2p-noise -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js"
4041
},

0 commit comments

Comments
 (0)