Skip to content

Commit

Permalink
Merge PR #1144 from 'theanmolsharma/gh-actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed May 31, 2023
2 parents 92433b2 + 5943dff commit 2221495
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .circleci/config.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build

on:
push:
branches:
- master
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install dependencies
run: npm install --location=global bslint

- name: Lint
run: npm run lint

test-coverage:
name: Test Coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install dependencies
run: npm install --location=global nyc codecov

- name: Rebuild
run: npm rebuild

- name: Test
run: npm run test-ci

- name: Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

build-test:
name: Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [18.x, 20.x]

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install bmocha
run: npm install --location=global bmocha

- name: Rebuild
run: npm rebuild

- name: Install
run: npm install --location=global

- name: Test
run: npm run test
8 changes: 8 additions & 0 deletions test/node-rpc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,17 @@ describe('RPC', function() {
});

it('should connect to a peer', async () => {
const waitForConnection = new Promise((resolve, reject) => {
node.pool.once('peer open', async (peer) => {
resolve(peer);
});
});

await node.connect();
await peer.open();
await peer.connect();

await waitForConnection;
});

it('should rpc getpeerinfo with peers', async () => {
Expand Down

0 comments on commit 2221495

Please sign in to comment.