Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions #626

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/vm-coverage.yml
@@ -0,0 +1,19 @@
name: vm-coverage
on: [push]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 8.x

- uses: actions/checkout@v1
- run: npm install
- run: npm run coverage
- run: npm run coveralls

- name: Post coverage data to coveralls.io for analysis
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/vm-lint.yml
@@ -0,0 +1,15 @@
name: vm-lint
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 8.x

- uses: actions/checkout@v1
- run: npm install
- run: npm run lint
env:
CI: true
90 changes: 90 additions & 0 deletions .github/workflows/vm-test.yml
@@ -0,0 +1,90 @@
name: vm-test
on: [push]
jobs:
test-api:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 8.x

- uses: actions/checkout@v1
- run: npm install

- run: npm run testAPI
env:
CI: true

- run: npm run testAPI:browser
env:
CI: true

test-state:
runs-on: ubuntu-latest
strategy:
matrix:
hardfork: ['Byzantium', 'Constantinople', 'Petersburg', 'Istanbul']

steps:
- uses: actions/setup-node@v1
with:
node-version: 8.x

- uses: actions/checkout@v1
- run: npm install
- run: mkdir -p tests/tape

- name: Run ${{ matrix.hardfork }} state tests
run: |
npm run ${{ format('testState{0}', matrix.hardfork) }} | tee -a ${{ format('testState{0}.tap', matrix.hardfork) }};
cat ${{ format('testState{0}.tap', matrix.hardfork) }} | npx tap-xunit > ${{ format('testState{0}.xml', matrix.hardfork) }}
env:
CI: true

- name: Upload ${{ matrix.hardfork }} state test metadata (if failure)
uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ format('vmTestState{0}', matrix.hardfork) }}
path: ${{ format('tests/tape/testState{0}.xml', matrix.hardfork) }}

- name: Upload state test metadata
uses: actions/upload-artifact@v1
with:
name: vmTestStateMetadata
path: tests/tape

test-blockchain:
runs-on: ubuntu-latest
strategy:
matrix:
hardfork: ['', 'Petersburg']

steps:
- uses: actions/setup-node@v1
with:
node-version: 8.x

- uses: actions/checkout@v1
- run: npm install
- run: mkdir -p tests/tape

- name: Run ${{ matrix.hardfork }} blockchain state tests
run: |
npm run ${{ format('testBlockchain{0}', matrix.hardfork) }} | tee -a ${{ format('testBlockchain{0}.tap', matrix.hardfork) }};
cat ${{ format('testBlockchain{0}.tap', matrix.hardfork) }} | npx tap-xunit > ${{ format('tests/tape/testBlockchain{0}.xml', matrix.hardfork) }}
env:
CI: true

- name: Upload ${{ matrix.hardfork }} blockchain state test metadata (if failure)
uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ format('vmTestBlockchainState{0}', matrix.hardfork) }}
path: ${{ format('tests/tape/testBlockchain{0}.xml', matrix.hardfork) }}

- name: Upload blockhain state test metadata
uses: actions/upload-artifact@v1
with:
name: vmTestBlockchainStateMetadata
path: tests/tape
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# SYNOPSIS

[![NPM Package](https://img.shields.io/npm/v/ethereumjs-vm.svg?style=flat-square)](https://www.npmjs.org/package/ethereumjs-vm)
[![Build Status](https://img.shields.io/circleci/project/github/ethereumjs/ethereumjs-vm/master.svg)](https://circleci.com/gh/ethereumjs/ethereumjs-vm)
[![Actions Status](https://github.com/ethereumjs/ethereumjs-vm/workflows/vm-test/badge.svg)](https://github.com/ethereumjs/ethereumjs-vm/actions)
[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-vm.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/ethereumjs-vm)
[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs)

Expand Down
2 changes: 1 addition & 1 deletion developer.md
Expand Up @@ -83,7 +83,7 @@ It is also possible to only run the tests from the skip lists:

### CI Test Integration

Tests are run on `CircleCI` on every PR, configuration can be found in `.circleci/config.yml`.
Tests are run on [Actions](https://github.com/ethereumjs/ethereumjs-vm/actions) on every PR, configuration can be found in `.github/workflows`.

### Debugging

Expand Down
21 changes: 9 additions & 12 deletions karma.conf.js
@@ -1,9 +1,8 @@
// Karma configuration
// Generated on Fri Mar 01 2019 22:02:29 GMT+0100 (CET)

module.exports = function (config) {
module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',

Expand All @@ -12,19 +11,17 @@ module.exports = function (config) {
frameworks: ['browserify', 'detectBrowsers', 'tap'],

// list of files / patterns to load in the browser
files: [
'./tests/api/**/*.js'
],
files: ['./tests/api/**/*.js'],

// list of files / patterns to exclude
exclude: [
'./tests/api/state/stateManager.js' // 4, "# should clear the cache when the state root is set"
'./tests/api/state/stateManager.js', // 4, "# should clear the cache when the state root is set"
],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'./tests/api/**/*.js': [ 'browserify' ]
'./tests/api/**/*.js': ['browserify'],
},

// test results reporter to use
Expand All @@ -47,7 +44,7 @@ module.exports = function (config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Firefox'],
browsers: ['FirefoxHeadless'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
Expand All @@ -57,9 +54,9 @@ module.exports = function (config) {
detectBrowsers: {
enabled: true,
usePhantomJS: false,
postDetection: function (availableBrowsers) {
return [ 'Firefox' ]
}
postDetection: function(availableBrowsers) {
return ['FirefoxHeadless']
},
},

// Concurrency level
Expand All @@ -68,6 +65,6 @@ module.exports = function (config) {

// Fail after timeout
browserDisconnectTimeout: 100000,
browserNoActivityTimeout: 100000
browserNoActivityTimeout: 100000,
})
}