Skip to content

Commit

Permalink
Tooling optimization (#778)
Browse files Browse the repository at this point in the history
* ci: moving coverage away from the heaviest job

* ci: simplifying npm commands

* tooling: makes husky lint parallel. 60% time gain

* ci: DRY-ing on path declarations

* ci: giving more priority to coverage report upload

* ci: using fixed paths for defaults property

* ci: installs lerna; bootstrap is still ran on postinstall

* lint: ignoring browser test files

* Unifying .gitignore files across packages

* Allowing package-lock.json files

* ci: scheduled CI runs with fresh packages

* ci: caching all node_modules

* ci: fix building all packages before test run

* enabling hoisting

* Scoped package installations, to circumvent gigantic cache size due to ethereumjs-testing

* lint

* ci: Namespacing cache keys

* tests: side-effects of hoisting

* ci: cache keys for each node version

* fixing lerna bootstrap command

* fixing namespaced cache keys

* fix: bump Common versions across packages

* Updating lockfiles

* fix: adding .cachedb to gitinore

* fixing namespaced cache keys

* fixing namespaced cache keys - hardcoded package name

* ci: empty commit to trigger jobs with cache
  • Loading branch information
evertonfraga committed Jun 25, 2020
1 parent 44f64ad commit e036600
Show file tree
Hide file tree
Showing 33 changed files with 34,179 additions and 539 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/account-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,50 @@ on:
- '*'
pull_request:
types: [opened, reopened, synchronize]

env:
cwd: ${{github.workspace}}/packages/account

defaults:
run:
working-directory: packages/account

jobs:
test-account:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13, 14]
env:
cwd: ${{github.workspace}}/packages/account
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1

- run: npx lerna bootstrap --scope @ethereumjs/account --ignore-scripts --include-dependencies --no-ci
- run: npx lerna run build --scope @ethereumjs/account --include-dependencies
- run: npx lerna run lint --scope @ethereumjs/account
- run: npx lerna run coverage --scope @ethereumjs/account
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: Account-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:account
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:account
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v1
with:
file: ${{ env.cwd }}/coverage/lcov.info
flags: account
if: ${{ matrix.node-version == 12 }}

- run: npm run lint
35 changes: 28 additions & 7 deletions .github/workflows/block-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,50 @@ on:
- '*'
pull_request:
types: [opened, reopened, synchronize]

env:
cwd: ${{github.workspace}}/packages/block

defaults:
run:
working-directory: packages/block

jobs:
test-block:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13, 14]
env:
cwd: ${{github.workspace}}/packages/block
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1

- run: npx lerna bootstrap --scope @ethereumjs/block --ignore-scripts --include-dependencies --no-ci
- run: npx lerna run build --scope @ethereumjs/block --include-dependencies
- run: npx lerna run lint --scope @ethereumjs/block
- run: npx lerna run coverage --scope @ethereumjs/block
- run: npx lerna run test:browser --scope @ethereumjs/block
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: Block-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:block
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:block
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v1
with:
file: ${{ env.cwd }}/coverage/lcov.info
flags: block
if: ${{ matrix.node-version == 12 }}

- run: npm run lint
34 changes: 28 additions & 6 deletions .github/workflows/blockchain-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,50 @@ on:
- '*'
pull_request:
types: [opened, reopened, synchronize]

env:
cwd: ${{github.workspace}}/packages/blockchain

defaults:
run:
working-directory: packages/blockchain

jobs:
test-blockchain:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13, 14]
env:
cwd: ${{github.workspace}}/packages/blockchain
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1

- run: npx lerna bootstrap --scope @ethereumjs/blockchain --ignore-scripts --include-dependencies --no-ci
- run: npx lerna run build --scope @ethereumjs/blockchain --include-dependencies
- run: npx lerna run lint --scope @ethereumjs/blockchain
- run: npx lerna run coverage --scope @ethereumjs/blockchain
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: Blockchain-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:blockchain
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:blockchain
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v1
with:
file: ${{ env.cwd }}/coverage/lcov.info
flags: blockchain
if: ${{ matrix.node-version == 12 }}

- run: npm run lint
34 changes: 28 additions & 6 deletions .github/workflows/common-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,50 @@ on:
- '*'
pull_request:
types: [opened, reopened, synchronize]

env:
cwd: ${{github.workspace}}/packages/common

defaults:
run:
working-directory: packages/common

jobs:
test-common:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13, 14]
env:
cwd: ${{github.workspace}}/packages/common
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1

- run: npx lerna bootstrap --scope @ethereumjs/common --ignore-scripts --include-dependencies --no-ci
- run: npx lerna run build --scope @ethereumjs/common --include-dependencies
- run: npx lerna run lint --scope @ethereumjs/common
- run: npx lerna run coverage --scope @ethereumjs/common
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: Common-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:common
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:common
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v1
with:
file: ${{ env.cwd }}/coverage/lcov.info
flags: common
if: ${{ matrix.node-version == 12 }}

- run: npm run lint
33 changes: 27 additions & 6 deletions .github/workflows/ethash-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,50 @@ on:
- '*'
pull_request:
types: [opened, reopened, synchronize]

env:
cwd: ${{github.workspace}}/packages/ethash

defaults:
run:
working-directory: packages/ethash

jobs:
test-ethash:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13, 14]
env:
cwd: ${{github.workspace}}/packages/ethash
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1

- run: npx lerna bootstrap --scope @ethereumjs/ethash --ignore-scripts --include-dependencies --no-ci
- run: npx lerna run build --scope @ethereumjs/ethash --include-dependencies
- run: npx lerna run lint --scope @ethereumjs/ethash
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: Ethash-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

- run: npx lerna run coverage --scope @ethereumjs/ethash
# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:ethash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:ethash
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v1
with:
file: ${{ env.cwd }}/coverage/lcov.info
flags: ethash
if: ${{ matrix.node-version == 12 }}

- run: npm run lint
34 changes: 28 additions & 6 deletions .github/workflows/tx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,50 @@ on:
- '*'
pull_request:
types: [opened, reopened, synchronize]

env:
cwd: ${{github.workspace}}/packages/tx

defaults:
run:
working-directory: packages/tx

jobs:
test-tx:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13, 14]
env:
cwd: ${{github.workspace}}/packages/tx
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1

- run: npx lerna bootstrap --scope @ethereumjs/tx --ignore-scripts --include-dependencies --no-ci
- run: npx lerna run build --scope @ethereumjs/tx --include-dependencies
- run: npx lerna run lint --scope @ethereumjs/tx
- run: npx lerna run coverage --scope @ethereumjs/tx
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: Tx-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:tx
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:tx
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v1
with:
file: ${{ env.cwd }}/coverage/lcov.info
flags: tx
if: ${{ matrix.node-version == 12 }}

- run: npm run lint
Loading

0 comments on commit e036600

Please sign in to comment.