Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #87 from ethereumjs/useGHActions
Browse files Browse the repository at this point in the history
Upgrade CI provider to use GH Actions in place of Travis
  • Loading branch information
holgerd77 authored Apr 30, 2020
2 parents b89c0c7 + 5e05e32 commit 4e805bb
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 45 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build
on:
push:
branches:
- master
tags:
- '*'
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
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 test

coverage:
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 coverage

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SYNOPSIS

[![NPM Package](https://img.shields.io/npm/v/rlp.svg?style=flat-square)](https://www.npmjs.org/package/rlp)
[![Build Status](https://img.shields.io/travis/ethereumjs/rlp.svg?branch=master&style=flat-square)](https://travis-ci.org/ethereumjs/rlp)
[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/rlp.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/rlp)
[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode
[![NPM Package](https://img.shields.io/npm/v/rlp.svg)](https://www.npmjs.org/package/rlp)
[![Actions Status](https://github.com/ethereumjs/rlp/workflows/Build/badge.svg)](https://github.com/ethereumjs/rlp/actions)
[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/rlp.svg)](https://coveralls.io/r/ethereumjs/rlp)
[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg)](https://gitter.im/ethereum/ethereumjs-lib)

[Recursive Length](https://github.com/ethereum/wiki/wiki/RLP) Prefix Encoding for node.js.

Expand Down
23 changes: 23 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = function(config) {
config.set({
frameworks: ['mocha', 'karma-typescript'],
files: ['src/**/*.ts', 'test/**/!(integration)*.ts'],
preprocessors: {
'**/*.ts': ['karma-typescript'],
},
plugins: ['karma-mocha', 'karma-typescript', 'karma-chrome-launcher', 'karma-firefox-launcher'],
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
},
},
colors: true,
reporters: ['progress', 'karma-typescript'],
browsers: ['FirefoxHeadless', 'ChromeHeadless'],
singleRun: true,
concurrency: Infinity,
// Fail after timeout
browserDisconnectTimeout: 100000,
browserNoActivityTimeout: 100000,
})
}
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@
"scripts": {
"build": "tsc -p ./tsconfig.prod.json",
"prepublishOnly": "npm run test && npm run build",
"coverage": "nyc mocha --reporter spec --require ts-node/register test/*.spec.ts",
"coveralls": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"coverage": "npm run build && nyc --reporter=lcov mocha --reporter=spec --require ts-node/register test/*.spec.ts",
"format": "prettier --list-different **/*.{ts,json,md,gql}",
"format:fix": "prettier --write **/*.{ts,json,md,gql}",
"tslint": "tslint -p ./tsconfig.json -e node_modules/**/* -e **/node_modules/**/* -e dist/**/* **/*.ts",
"tslint:fix": "tslint --fix --format stylish -p ./tsconfig.json -e node_modules/**/* -e **/node_modules/**/* -e dist/**/* **/*.ts",
"tsc": "tsc --noEmit",
"tsc": "tsc -p ./tsconfig.prod.json --noEmit",
"lint": "npm run format && npm run tslint && npm run tsc",
"lint:fix": "npm run format:fix && npm run tslint:fix && npm run tsc",
"unitTests": "mocha --reporter spec --require ts-node/register test/*.spec.ts",
"test": "npm run lint && npm run unitTests",
"test:fix": "npm run lint:fix && npm run unitTests",
"webtest": "browserify test/max.js | testling -u"
"test": "npm run lint && npm run build && npm run unitTests && npm run test:browser",
"test:browser": "karma start karma.conf.js",
"test:fix": "npm run lint:fix && npm run unitTests"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -61,14 +60,18 @@
"@types/bn.js": "^4.11.3",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.2",
"coveralls": "^2.11.4",
"husky": "^2.1.0",
"mocha": "4.1.0",
"nyc": "^13.1.0",
"karma": "^5.0.2",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^2.0.0",
"karma-typescript": "^4.1.1",
"mocha": "7.1.2",
"nyc": "^15.0.1",
"prettier": "^1.15.2",
"ts-node": "^7.0.1",
"ts-node": "^8.9.1",
"tslint": "^5.11.0",
"typescript": "^3.1.6",
"typescript": "^3.8.3",
"typestrict": "^1.0.1"
},
"bin": {
Expand Down
11 changes: 7 additions & 4 deletions test/dataTypes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { version } from 'process'
import * as assert from 'assert'
import * as RLP from '../src'
const BN = require('bn.js')
const Buffer = require('buffer').Buffer // needed for karma

describe('invalid rlps', function() {
it('should not crash on an invalid rlp', function() {
Expand Down Expand Up @@ -64,10 +65,12 @@ describe('RLP encoding (list):', function() {

describe('RLP encoding (BigInt):', function() {
before(function() {
const nodeVersionNumber = Number(version.match(/^v([0-9]+)/)![1])
if (nodeVersionNumber < 10) {
// tslint:disable-next-line no-invalid-this
this.skip()
if (version) {
const nodeVersionNumber = Number(version.match(/^v([0-9]+)/)![1])
if (nodeVersionNumber < 10) {
// tslint:disable-next-line no-invalid-this
this.skip()
}
}
})
it('should encode a BigInt value', function() {
Expand Down

0 comments on commit 4e805bb

Please sign in to comment.