Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
upgrade to github actions for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Jun 1, 2020
1 parent ea7a352 commit d64c84d
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 32 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build
on:
push:
branches:
- master
tags:
- '*'
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1
- run: npm install
- run: npm run coverage
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-browser:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v1
- run: npm install
- run: npm run test:browser
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

44 changes: 44 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = function (config) {
config.set({
frameworks: ['browserify', 'tap'],

files: ['dist/bundle.js', './test/**/*.js'],

// Exclude [test/node.js, test/net, test/sync, test/service] due to error: `Sorry, but CommonJS module replacement with td.replace() is only supported under Node.js runtimes.`
// Exclude [test/rpc] due to error: `TypeError: superCtor is undefined`
// Exclude [test/util/parse] due to hanging on `should parse geth params file`
// Exclude [test/logging] due to error: `TypeError: logger.format is undefined`
exclude: [
'./test/node.js',
'./test/net/**/*.js',
'./test/sync/**/*.js',
'./test/service/**/*.js',
'./test/rpc/**/*.js',
'./test/util/parse.js',
'./test/logging.js',
'./test/integration/**/*.js'
],

preprocessors: {
'./test/**/*.js': ['browserify']
},

reporters: ['progress'],

browsers: ['FirefoxHeadless', 'ChromeHeadless'],

colors: true,

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,

// Fail after timeout
browserDisconnectTimeout: 100000,
browserNoActivityTimeout: 100000
})
}
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"lib"
],
"scripts": {
"coverage": "nyc npm run test && nyc report --reporter=text-lcov > .nyc_output/lcov.info",
"coveralls": "npm run coverage && coveralls <.nyc_output/lcov.info",
"coverage": "nyc npm run test && nyc report --reporter=lcov",
"docs": "jsdoc2md --no-cache -c .jsdoc.json lib/*.js > docs/API.md",
"lint": "standard",
"lint:fix": "standard --fix",
"unit": "tape 'test/!(integration)/**/*.js'",
"integration": "tape 'test/integration/**/*.js'",
"test": "npm run lint && npm run unit && npm run integration",
"build": "npm run test && browserify browser/index.js -s ethereumjs -t babelify --outfile dist/bundle.js"
"test": "npm run lint && npm run test:unit && npm run test:integration",
"test:unit": "tape 'test/!(integration)/**/*.js'",
"test:integration": "tape 'test/integration/**/*.js'",
"test:browser": "npm run build && karma start karma.conf.js",
"build": "browserify browser/index.js -s ethereumjs -t babelify --outfile dist/bundle.js"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -90,9 +90,13 @@
"@babel/runtime-corejs2": "^7.1.2",
"babelify": "^10.0.0",
"browserify": "^16.2.3",
"coveralls": "^3.0.0",
"husky": "^2.1.0",
"json-to-markdown": "^1.0.4",
"karma": "^5.0.9",
"karma-browserify": "^7.0.0",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^1.3.0",
"karma-tap": "^4.2.0",
"nyc": "~13.3.0",
"pino": "^5.8.0",
"pino-pretty": "^2.2.2",
Expand Down

0 comments on commit d64c84d

Please sign in to comment.