Skip to content

Commit

Permalink
Merge pull request #2 from ethereumjs/master
Browse files Browse the repository at this point in the history
Update from original repo
  • Loading branch information
stan7123 authored Aug 21, 2023
2 parents c83f11b + b1129f0 commit 6f9ad7c
Show file tree
Hide file tree
Showing 1,124 changed files with 98,297 additions and 103,262 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/block-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -40,9 +40,7 @@ jobs:

- run: npm run lint
- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: block
if: ${{ matrix.node-version == 16 }}
6 changes: 2 additions & 4 deletions .github/workflows/blockchain-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand All @@ -38,9 +38,7 @@ jobs:

- run: npm run lint
- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: blockchain
if: ${{ matrix.node-version == 16 }}
flags: blockchain
53 changes: 53 additions & 0 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Browser
on:
push:
branches: [master, develop]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:

env:
cwd: ${{github.workspace}}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

jobs:
test-all-browser:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive # necessary for block tests to load ethereum/tests

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm ci

# Install playwright dependencies
- run: npx playwright install-deps

- run: npm run test:browser -w=@ethereumjs/rlp
- run: npm run test:browser -w=@ethereumjs/util
- run: npm run test:browser -w=@ethereumjs/common
- run: npm run test:browser -w=@ethereumjs/trie
- run: npm run test:browser -w=@ethereumjs/tx
- run: npm run test:browser -w=@ethereumjs/block
# No browser tests for devp2p
- run: npm run test:browser -w=@ethereumjs/blockchain
# No browser tests for ethash
- run: npm run test:browser -w=@ethereumjs/wallet
- run: npm run test:browser -w=@ethereumjs/statemanager
- run: npm run test:browser -w=@ethereumjs/evm
# VM: several tests not passing yet
# - run: npm run test:browser -w=@ethereumjs/vm

9 changes: 2 additions & 7 deletions .github/workflows/client-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand All @@ -37,21 +37,16 @@ jobs:
working-directory: ${{github.workspace}}

- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: client
if: ${{ matrix.node-version == 16 }}

- uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: cd ${{github.workspace}}/packages/client && npm run test:integration

- run: npm run test:browser

- run: npm run lint

test-client-dockerfile:
Expand Down Expand Up @@ -100,4 +95,4 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
command: cd ${{github.workspace}}/packages/client && npm run tape -- 'test/sim/mainnet.spec.ts'
command: cd ${{github.workspace}}/packages/client && npx vitest run test/cli/cli
4 changes: 1 addition & 3 deletions .github/workflows/common-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand All @@ -38,9 +38,7 @@ jobs:

- run: npm run lint
- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: common
if: ${{ matrix.node-version == 16 }}
8 changes: 1 addition & 7 deletions .github/workflows/devp2p-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand All @@ -42,10 +42,4 @@ jobs:
max_attempts: 3
command: cd ${{github.workspace}}/packages/devp2p && npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: devp2p
if: ${{ matrix.node-version == 16 }}

- run: npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/e2e-hardhat.yml.old
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ethash-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand All @@ -38,9 +38,7 @@ jobs:

- run: npm run lint
- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: ethash
if: ${{ matrix.node-version == 16 }}
flags: ethash
6 changes: 2 additions & 4 deletions .github/workflows/evm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -40,9 +40,7 @@ jobs:

- run: npm run lint
- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: evm
if: ${{ matrix.node-version == 16 }}
flags: evm
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
cache: 'npm'

- run: npm ci
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ jobs:
filters: |
src:
- 'package-lock.json'
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18
cache: 'npm'

- if: steps.changes.outputs.src == 'true'
run: npx lockfile-lint --path="package-lock.json" --allowed-hosts=npm --allowed-schemes "file:" "https:" "npm:"
run: npm install lockfile-lint-api && node scripts/lockfile-lint.js
71 changes: 17 additions & 54 deletions .github/workflows/node-versions.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
# This special file aims to run node tests for each relevant node version.
# A relevant node version can be: active, current, maintenance or EOL with some months of tolerance
# For more details, please check https://github.com/evertonfraga/testable-node-versions
name: Node versions
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
get-node-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/setup-node@v2
with:
node-version: 16

- id: set-matrix
run: echo "::set-output name=matrix::$(npx testable-node-versions)"

tests:
needs: get-node-versions
runs-on: ubuntu-latest
strategy:
matrix:
node: ${{ fromJson(needs.get-node-versions.outputs.matrix) }}
node-version: [18, 20]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand All @@ -35,85 +19,64 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Use npm v7 for workspaces support
run: npm i -g npm@7
if: ${{ matrix.node-version < 16 }}

- run: npm ci

# Added a check to ensure we only run on NodeJS 14 or later to all jobs until the `node-testable-versions` script stops picking up 12.

- name: Test Block
run: npm run test
run: npm run test:node
working-directory: packages/block
if: ${{ matrix.node >= 14 }}

- name: Test Blockchain
run: npm run test
run: npm run test:node
working-directory: packages/blockchain
if: ${{ matrix.node >= 14 }}

# Client and Devp2p temporarily disabled for Node < 15 due to browser build
# error along node-versions CI run "TextDecoder is not defined" triggered in
# older Noder versions (Node 12/14)
# https://github.com/ethereumjs/ethereumjs-monorepo/pull/1305
# 2021-06-18
#

# Switch client to unit tests only due to `async_hooks` dependency build error in browser tests: 2022-06-15
- name: Test Client
run: npm run test:unit
run: npm run test
working-directory: packages/client
if: ${{ matrix.node >= 14 }}

- name: Test Devp2p
run: npm run test
working-directory: packages/devp2p
if: ${{ matrix.node >= 14 }}

- name: Test Common
run: npm run test
run: npm run test:node
working-directory: packages/common
if: ${{ matrix.node >= 14 }}

- name: Test Ethash
run: npm run test
working-directory: packages/ethash
if: ${{ matrix.node >= 14 }}

- name: Test EVM
run: npm run test
run: npm run test:node
working-directory: packages/evm
if: ${{ matrix.node >= 14 }}

- name: Test Trie
run: npm run test
run: npm run test:node
working-directory: packages/trie
if: ${{ matrix.node >= 14 }}

- name: Test Tx
run: npm run test
run: npm run test:node
working-directory: packages/tx
if: ${{ matrix.node >= 14 }}

- name: Test Util
run: npm run test
run: npm run test:node
working-directory: packages/util
if: ${{ matrix.node >= 14 }}

- name: Test StateManager
run: npm run test
run: npm run test:node
working-directory: packages/statemanager
if: ${{ matrix.node >= 14 }}

- name: Test VM
run: npm run test:API
working-directory: packages/vm
if: ${{ matrix.node >= 14 }}

- name: Test RLP
run: npm run test
run: npm run test:node
working-directory: packages/rlp
if: ${{ matrix.node >= 14 }}

- name: Test Wallet
run: npm run test:node
working-directory: packages/wallet
4 changes: 1 addition & 3 deletions .github/workflows/rlp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- uses: actions/checkout@v3

Expand All @@ -38,9 +38,7 @@ jobs:

- run: npm run lint
- run: npm run coverage

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: rlp
if: ${{ matrix.node-version == 16 }}
Loading

0 comments on commit 6f9ad7c

Please sign in to comment.