Skip to content

Commit

Permalink
Upgrade CI provider from Travis to GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Apr 16, 2020
1 parent 1149c41 commit 7bacb68
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 97 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "Build"
on:
push:
branches:
- master
tags:
- "*"
pull_request:
types: [opened, reopened, synchronize]
jobs:
lint:
runs-on: ubuntu-latest
env:
TEST: "build_and_lint"
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/checkout@v1
- run: bash ./scripts/install.sh
- run: bash ./scripts/ci.sh
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [8, 10, 11, 12, 13]
env:
TEST: "unit"
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v1
- run: bash ./scripts/install.sh
- run: bash ./scripts/ci.sh
e2e-test:
runs-on: ubuntu-latest
strategy:
matrix:
testCmd:
[
"unit_and_e2e_clients",
"e2e_ganache",
"e2e_mosaic",
"e2e_ens",
"e2e_browsers",
]
env:
TEST: ${{ matrix.testCmd }}
CI: true
DISPLAY: :99.0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/checkout@v1

- run: bash ./scripts/install.sh
- run: bash ./scripts/ci.sh
continue-on-error: ${{ matrix.testCmd == 'e2e_ganache' || matrix.testCmd == 'e2e_mosiac' }}

- name: Send coverage reports to Coveralls
if: env.TEST == 'unit_and_e2e_clients'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
e2e-test-windows:
runs-on: windows-latest
env:
TEST: "e2e_windows"
CI: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/checkout@v1
- run: bash ./scripts/install.sh
- run: bash ./scripts/ci.sh
continue-on-error: true
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ coverage
scripts
.gitignore
.editorconfig
.travis.yml
.npmignore
.DS_Store
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ Released with 1.0.0-beta.37 code base.

- ENS registry addresses updated (#3353, https://medium.com/the-ethereum-name-service/ens-registry-migration-bug-fix-new-features-64379193a5a)

## [Unreleased]

## [1.2.7]

### Added
Expand Down Expand Up @@ -173,3 +171,15 @@ Released with 1.0.0-beta.37 code base.
- Race-condition when subscribing to historical logs as first client request (#3389)
- Fix crash when using Web-Workers by removing any-promise dependency (#3377 #2211 #1774)
- MaxListenersExceededWarning event emitter warning mitigated (#1648)

## [Unreleased]

## [1.2.8]

### Added

### Changed

- Change CI provider from Travis to Github Actions. (#3468)

### Fixed
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# web3.js - Ethereum JavaScript API

[![Gitter][gitter-image]][gitter-url] [![StackExchange][stackexchange-image]][stackexchange-url] [![NPM Package Version][npm-image-version]][npm-url] [![NPM Package Downloads][npm-image-downloads]][npm-url] [![Build Status][travis-image]][travis-url] [![Dev Dependency Status][deps-dev-image]][deps-dev-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Lerna][lerna-image]][lerna-url]
[![Gitter][gitter-image]][gitter-url] [![StackExchange][stackexchange-image]][stackexchange-url] [![NPM Package Version][npm-image-version]][npm-url] [![NPM Package Downloads][npm-image-downloads]][npm-url] [![Build Status][actions-image]][actions-url] [![Dev Dependency Status][deps-dev-image]][deps-dev-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Lerna][lerna-image]][lerna-url]

This is the Ethereum [JavaScript API][docs]
which connects to the [Generic JSON-RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) spec.
Expand Down Expand Up @@ -165,10 +165,12 @@ The contribution guidelines are provided in [CONTRIBUTIONS](./CONTRIBUTIONS.md)
[npm-image-version]: https://img.shields.io/npm/v/web3.svg
[npm-image-downloads]: https://img.shields.io/npm/dm/web3.svg
[npm-url]: https://npmjs.org/package/web3
[travis-image]: https://travis-ci.org/ethereum/web3.js.svg?branch=1.x
[travis-url]: https://travis-ci.org/ethereum/web3.js?branch=1.x
[actions-image]: https://github.com/ethereum/web3.js/workflows/Build/badge.svg
[actions-url]: https://github.com/ethereum/web3.js/actions
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/1.x/dev-status.svg
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/1.x?type=dev
[dep-dev-image]: https://david-dm.org/ethereum/web3.js/dev-status.svg
[dep-dev-url]: https://david-dm.org/ethereum/web3.js#info=devDependencies
[coveralls-image]: https://coveralls.io/repos/ethereum/web3.js/badge.svg?branch=1.x
[coveralls-url]: https://coveralls.io/r/ethereum/web3.js?branch=1.x
[waffle-image]: https://badge.waffle.io/ethereum/web3.js.svg?label=ready&title=Ready
Expand Down
3 changes: 0 additions & 3 deletions circle.yml

This file was deleted.

10 changes: 5 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process.env.MOZ_HEADLESS = 1;

if (!process.env.TRAVIS){
if (!process.env.GITHUB_ACTION) {
process.env.CHROME_BIN = require('puppeteer').executablePath();
}

Expand Down Expand Up @@ -50,19 +50,19 @@ module.exports = function (config) {
base: 'Firefox',
flags: ['-headless'],
},
Chrome_travis_ci: {
Chrome_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
};

if(process.env.TRAVIS) {
if(process.env.GITHUB_ACTION) {
configuration.browsers = [
'Chrome_travis_ci',
'Chrome_ci',
'FirefoxHeadless'
];
}

config.set(configuration);
};
};
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"lint": "jshint *.js packages",
"test": "mocha --grep E2E --invert; jshint *.js packages",
"test:unit": "nyc --no-clean --silent _mocha -- -R spec --grep E2E --invert --exit",
"test:cov": "npm run cov:clean; npm run test:unit; npm run test:e2e:clients; npm run cov:html",
"test:cov": "npm run cov:clean; npm run test:unit; npm run test:e2e:clients; npm run cov:merge_reports",
"dtslint": "lerna run dtslint",
"depcheck": "lerna exec dependency-check -- --missing --verbose .",
"bundlesize": "bundlesize",
Expand All @@ -49,9 +49,8 @@
"test:e2e:mosaic": "./scripts/e2e.mosaic.sh",
"test:e2e:ganache:core": "./scripts/e2e.ganache.core.sh",
"ci": "./scripts/ci.sh",
"coveralls": "./scripts/coveralls.sh",
"cov:clean": "rm -rf .nyc_output; rm -rf coverage",
"cov:html": "nyc report --reporter=html"
"cov:merge_reports": "nyc report --reporter=lcov --reporter=html"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -108,7 +107,6 @@
"bundlesize": "^0.18.0",
"chai": "^4.2.0",
"core-js": "^3.4.8",
"coveralls": "^3.0.7",
"crypto-js": "^3.1.9-1",
"del": "^4.1.1",
"dependency-check": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# -----------------------------
# Travis CI matrix job selector
# CI matrix job selector
# -----------------------------

# Exit immediately on error
Expand All @@ -24,7 +24,7 @@ elif [ "$TEST" = "unit_and_e2e_clients" ]; then
npm run test:e2e:geth:insta
npm run test:e2e:geth:auto
npm run test:unit
npm run coveralls
npm run cov:merge_reports

elif [ "$TEST" = "e2e_browsers" ]; then

Expand Down
7 changes: 0 additions & 7 deletions scripts/coveralls.sh

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/e2e.ganache.core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Installing updated web3 via virtual registry "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

npm config set fetch-retry-mintimeout 100000
npm config set fetch-retry-maxtimeout 600000

npm install
npm uninstall --save-dev web3
npm install --save-dev web3@e2e --registry http://localhost:4873
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e.mosaic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
git submodule update --init --recursive
yarn --registry http://localhost:4873

yarn add web3@e2e --registry http://localhost:4873
yarn add web3@e2e --registry http://localhost:4873 --network-timeout 600000

yarn list web3
yarn list web3-utils
Expand Down
14 changes: 7 additions & 7 deletions scripts/e2e.npm.publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
# To model publication correctly, this script needs to run
# without web3's dev deps being installed. It installs
# what it needs here.
npm install -g [email protected].2
npm install -g [email protected].4
npm install -g [email protected]
npm install -g [email protected]

Expand All @@ -46,11 +46,10 @@ npm-auth-to-token \
-r http://localhost:4873

# Prep branch for Lerna's git-checks
BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
if [ -z "$BRANCH" ]; then

BRANCH=$TRAVIS_BRANCH

if [[ $GITHUB_REF = 'refs/pull/'* ]]; then
BRANCH=${GITHUB_HEAD_REF#refs/pull/}
else
BRANCH=${GITHUB_REF#refs/heads/}
fi

git checkout $BRANCH --
Expand All @@ -63,8 +62,9 @@ lerna version minor \
--allow-branch $BRANCH \
--yes

# Set email prior to publishing (necessary for Windows)
# Set identity prior to publishing (necessary for Windows)
git config user.email "[email protected]"
git config user.name "Your Name"

# Commit changes because lerna checks git before
git commit -a -m 'virtual-version-bump'
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e.truffle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# --------------------------------------------------------------------------------
# NB: This script temporarily removed from CI while truffle remains on [email protected].
# To re-enable, add a `env: TEST=e2e_truffle` job to the matrix in travis.yml.
# To re-enable, add a `e2e_truffle` job to the matrix in `.github/workflows/test.yml`.
# --------------------------------------------------------------------------------

# -------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# This script contains conditional installation logic for Travis CI
# This script contains conditional installation logic for CI

# CI jobs we'd like to skip default installation for:
# Helpful for E2E tests where the dev deps might cause problems
Expand Down
2 changes: 2 additions & 0 deletions verdaccio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ packages:
proxy: npmjs yarn
logs:
- {type: stdout, format: pretty, level: warn}
server:
keepAliveTimeout: 600 # specified in seconds

0 comments on commit 7bacb68

Please sign in to comment.