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

WIP - Rework CI for build jobs #2709

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a9e4775
Call `dpt.destroy` inside rlpx
acolytec3 May 17, 2023
03dced0
Turn off github actions
acolytec3 May 17, 2023
aba9449
Add wtfnode
acolytec3 May 17, 2023
a8d90b7
shorten timeout on retry
acolytec3 May 17, 2023
5da5bb1
Merge remote-tracking branch 'origin/master' into devp2p-timeout-fixes
acolytec3 May 17, 2023
e4ecd4e
Ensure peer disconnects
acolytec3 May 17, 2023
f277391
Merge remote-tracking branch 'origin/master' into devp2p-timeout-fixes
acolytec3 May 17, 2023
7e284cd
Slight disconnect tweak
acolytec3 May 18, 2023
845ca4f
Ensure peer refreshIntervals are cleared
acolytec3 May 18, 2023
f358ec8
clear interval in peer disconnect
acolytec3 May 18, 2023
b2e4904
Add client wtfnode ci run
acolytec3 May 19, 2023
f23f423
run block and devp2p
acolytec3 May 20, 2023
7dea35c
cache build outputs
acolytec3 May 20, 2023
a463571
only run block coverage
acolytec3 May 20, 2023
cbcc09f
cache everything
acolytec3 May 22, 2023
e66a2a2
Adjust working directory
acolytec3 May 22, 2023
295e2c6
fix working dir
acolytec3 May 22, 2023
3302097
add submodules to block
acolytec3 May 22, 2023
97ba6c3
Add separate lint check
acolytec3 May 22, 2023
caea991
add vm
acolytec3 May 22, 2023
1781cc0
set correct job ordering
acolytec3 May 22, 2023
d6d11fb
Add restore step to vm:blockchain
acolytec3 May 22, 2023
b3776cd
Add workflow dependency
acolytec3 May 22, 2023
24eaa59
add jobs
acolytec3 May 22, 2023
1d988cc
call block in devp2p
acolytec3 May 22, 2023
f3fda49
Need build
acolytec3 May 22, 2023
0ec02a5
Try reusable workflows
acolytec3 May 22, 2023
1260626
remove build dep
acolytec3 May 22, 2023
bfd9b2c
update concurrency
acolytec3 May 22, 2023
6b0b207
add ethash and common
acolytec3 May 22, 2023
91282fe
add trie and build
acolytec3 May 22, 2023
5714fa2
Up setup-node to v3
acolytec3 May 26, 2023
1715b9b
Update lockfile
acolytec3 May 26, 2023
ebcfa43
pass cache-key to block
acolytec3 May 26, 2023
aa932f8
better hash key
acolytec3 May 26, 2023
2165c3a
Cache key redux
acolytec3 May 26, 2023
0dd516d
correct cache key usage
acolytec3 May 26, 2023
da10082
remove package lock
acolytec3 May 26, 2023
c8d1cd7
remove package lock
acolytec3 May 26, 2023
dcccb6a
fix inputs
acolytec3 May 26, 2023
69a8301
fix syntax
acolytec3 May 26, 2023
7d1e7de
Remove echo
acolytec3 May 26, 2023
2478549
add cachekey
acolytec3 May 26, 2023
b071ada
Add all package test suites to build script
acolytec3 May 27, 2023
5bee0f6
TYPO
acolytec3 May 27, 2023
1123344
run ci if cache miss
acolytec3 May 27, 2023
743ab98
Add fake key to dispatch
acolytec3 May 27, 2023
78b5e49
make cache key optional
acolytec3 May 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .github/workflows/block-build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
name: Block
on:
push:
branches: [master, develop]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_call:
inputs:
cache-key:
required: false
type: string
workflow_dispatch:
inputs:
cache-key:
required: false
type: string

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

defaults:
run:
working-directory: packages/block
env:
cwd: ${{github.workspace}}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-block
cancel-in-progress: true

jobs:
test-block:
defaults:
run:
working-directory: ${{github.workspace}}/packages/block
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -30,19 +34,25 @@ jobs:
submodules: recursive

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

- run: npm ci
working-directory: ${{github.workspace}}
- uses: actions/cache/restore@v3
with:
path: ${{github.workspace}}
key: ${{ inputs.cache-key }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

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

- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
files: ${{ github.workspace}}/packages/block/coverage/lcov.info
flags: block
if: ${{ matrix.node-version == 16 }}
17 changes: 10 additions & 7 deletions .github/workflows/blockchain-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Blockchain
on:
push:
branches: [master, develop]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_call:
inputs:
cache-key:
required: true
type: string
workflow_dispatch:

env:
Expand Down Expand Up @@ -33,8 +33,11 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm ci
working-directory: ${{github.workspace}}

- uses: actions/cache/restore@v3
with:
path: ${{github.workspace}}
key: ${{ inputs.cache-key }}

- run: npm run lint
- run: npm run coverage
Expand Down
132 changes: 132 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Build
on:
push:
branches: [master]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:

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

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

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

- run: npm ci
working-directory: ${{github.workspace}}

- uses: actions/cache@v3
with:
path: ${{github.workspace}}
key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

- run: echo ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

block:
needs: build
uses: ./.github/workflows/block-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

blockchain:
needs: build
uses: ./.github/workflows/blockchain-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

client:
needs: build
uses: ./.github/workflows/client-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

common:
needs: build
uses: ./.github/workflows/common-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

devp2p:
needs: build
uses: ./.github/workflows/devp2p-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

ethash:
needs: build
uses: ./.github/workflows/ethash-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

evm:
needs: build
uses: ./.github/workflows/evm-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

examples:
needs: build
uses: ./.github/workflows/examples.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

rlp:
needs: build
uses: ./.github/workflows/rlp-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

statemanager:
needs: build
uses: ./.github/workflows/statemanager-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

trie:
needs: build
uses: ./.github/workflows/trie-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

tx:
needs: build
uses: ./.github/workflows/tx-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

util:
needs: build
uses: ./.github/workflows/block-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

vm-build:
needs: build
uses: ./.github/workflows/vm-build.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build

vm-pr:
needs: build
uses: ./.github/workflows/vm-pr.yml
with:
cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
79 changes: 12 additions & 67 deletions .github/workflows/client-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Client
on:
push:
branches: [master, develop]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_call:
inputs:
cache-key:
required: true
type: string
workflow_dispatch:

env:
Expand Down Expand Up @@ -33,71 +33,16 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm ci
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:
name: test client docker file
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build from npm
run: >
docker buildx build .
--tag ethereumjs:local-npm
--platform linux/amd64
--build-arg COMMIT=$(git rev-parse HEAD)
working-directory: ${{github.workspace}}
- name: Build from source
run: >
docker buildx build .
-f Dockerfile.fromSource
--tag ethereumjs:local-source
--platform linux/amd64
--build-arg COMMIT=$(git rev-parse HEAD)
working-directory: ${{github.workspace}}

test-client-cli:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- uses: actions/cache/restore@v3
with:
node-version: 18
cache: 'npm'
path: ${{github.workspace}}
key: ${{ inputs.cache-key }}

- run: npm ci
working-directory: ${{github.workspace}}
- run: npm i wtfnode

- uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: cd ${{github.workspace}}/packages/client && npm run tape -- 'test/sim/mainnet.spec.ts'
timeout_minutes: 2
max_attempts: 1
command: cd ${{github.workspace}}/packages/client && npx wtfnode ../../node_modules/tape/bin/tape -r ts-node/register './test/**/*.spec.ts'
20 changes: 11 additions & 9 deletions .github/workflows/common-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Common
on:
push:
branches: [master, develop]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_call:
inputs:
cache-key:
required: true
type: string
workflow_dispatch:

env:
Expand All @@ -15,7 +15,7 @@ defaults:
working-directory: packages/common

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-common
cancel-in-progress: true

jobs:
Expand All @@ -28,13 +28,15 @@ jobs:
- uses: actions/checkout@v3

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

- run: npm ci
working-directory: ${{github.workspace}}
- uses: actions/cache/restore@v3
with:
path: ${{github.workspace}}
key: ${{ inputs.cache-key }}

- run: npm run lint
- run: npm run coverage
Expand Down
Loading