From b7125d5e1bccfc6bdf533f7053bd36d0e480de7f Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:31:45 +0200 Subject: [PATCH 01/10] ci experiment: cache monorepo build --- .github/workflows/block-build.yml | 24 +++++------------ .github/workflows/build-monorepo.yml | 39 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/build-monorepo.yml diff --git a/.github/workflows/block-build.yml b/.github/workflows/block-build.yml index 83d81229c8..de61e9564b 100644 --- a/.github/workflows/block-build.yml +++ b/.github/workflows/block-build.yml @@ -24,23 +24,11 @@ jobs: strategy: matrix: node-version: [18] + needs: build-monorepo steps: - - uses: actions/checkout@v4 + - name: 'Cache build' + - uses: 'actions/cache@v3' with: - submodules: recursive - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - run: npm ci --omit=peer - working-directory: ${{github.workspace}} - - - run: npm run lint - - run: npm run coverage - - uses: codecov/codecov-action@v3 - with: - files: ${{ env.cwd }}/coverage/lcov.info - flags: block + path: '.' + key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' + restore-keys: '${{ runner.os }}-node-18' \ No newline at end of file diff --git a/.github/workflows/build-monorepo.yml b/.github/workflows/build-monorepo.yml new file mode 100644 index 0000000000..effe8658e3 --- /dev/null +++ b/.github/workflows/build-monorepo.yml @@ -0,0 +1,39 @@ +name: Build +on: + push: + branches: [master, develop] + tags: ['*'] + pull_request: + types: [opened, reopened, synchronize] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build-monorepo: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18] + steps: + - name: Checkout monorepo + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup node + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + + - name: 'Cache build' + - uses: 'actions/cache@v3' + with: + path: '.' + key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' + restore-keys: '${{ runner.os }}-node-18' + + - run: npm i \ No newline at end of file From 80af1ac3ae820d82ff46d8dc8114b743ca724feb Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:38:25 +0200 Subject: [PATCH 02/10] disable almost all ci - REMOVE ME --- .github/workflows/blockchain-build.yml | 4 ++-- .github/workflows/browser.yml | 4 ++-- .github/workflows/client-build.yml | 4 ++-- .github/workflows/common-build.yml | 4 ++-- .github/workflows/devp2p-build.yml | 4 ++-- .github/workflows/ethash-build.yml | 4 ++-- .github/workflows/evm-build.yml | 4 ++-- .github/workflows/examples.yml | 4 ++-- .github/workflows/genesis-build.yml | 4 ++-- .github/workflows/lockfile.yml | 4 ++-- .github/workflows/rlp-build.yml | 4 ++-- .github/workflows/statemanager-build.yml | 4 ++-- .github/workflows/trie-build.yml | 4 ++-- .github/workflows/tx-build.yml | 4 ++-- .github/workflows/util-build.yml | 4 ++-- .github/workflows/verkle-build.yml | 4 ++-- .github/workflows/vm-pr.yml | 4 ++-- .github/workflows/wallet-build.yml | 4 ++-- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/blockchain-build.yml b/.github/workflows/blockchain-build.yml index d8faae7d70..83537d07f5 100644 --- a/.github/workflows/blockchain-build.yml +++ b/.github/workflows/blockchain-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/browser.yml b/.github/workflows/browser.yml index 5465463ef3..a10e44e197 100644 --- a/.github/workflows/browser.yml +++ b/.github/workflows/browser.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index 065e7185e3..84ade1f377 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/common-build.yml b/.github/workflows/common-build.yml index ec2a134ad2..326c9ba149 100644 --- a/.github/workflows/common-build.yml +++ b/.github/workflows/common-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/devp2p-build.yml b/.github/workflows/devp2p-build.yml index 9da55bc3b7..89eb3e652e 100644 --- a/.github/workflows/devp2p-build.yml +++ b/.github/workflows/devp2p-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/ethash-build.yml b/.github/workflows/ethash-build.yml index e9a90041c6..828716417d 100644 --- a/.github/workflows/ethash-build.yml +++ b/.github/workflows/ethash-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/evm-build.yml b/.github/workflows/evm-build.yml index d1fbe170de..c1b502cd15 100644 --- a/.github/workflows/evm-build.yml +++ b/.github/workflows/evm-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 65ed2467f0..4372a56655 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: concurrency: diff --git a/.github/workflows/genesis-build.yml b/.github/workflows/genesis-build.yml index 5eb151352f..7deab1d0f4 100644 --- a/.github/workflows/genesis-build.yml +++ b/.github/workflows/genesis-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/lockfile.yml b/.github/workflows/lockfile.yml index 5ff7cd8853..05325525a0 100644 --- a/.github/workflows/lockfile.yml +++ b/.github/workflows/lockfile.yml @@ -1,8 +1,8 @@ name: lockfile-lint on: - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/rlp-build.yml b/.github/workflows/rlp-build.yml index d7de54212e..1bedaf0bf4 100644 --- a/.github/workflows/rlp-build.yml +++ b/.github/workflows/rlp-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/statemanager-build.yml b/.github/workflows/statemanager-build.yml index e3477e5c0e..ab2663fdbc 100644 --- a/.github/workflows/statemanager-build.yml +++ b/.github/workflows/statemanager-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/trie-build.yml b/.github/workflows/trie-build.yml index 37d92c3986..9df11a70c8 100644 --- a/.github/workflows/trie-build.yml +++ b/.github/workflows/trie-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/tx-build.yml b/.github/workflows/tx-build.yml index 01bcb0f3f9..473ca3db79 100644 --- a/.github/workflows/tx-build.yml +++ b/.github/workflows/tx-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/util-build.yml b/.github/workflows/util-build.yml index 194edee319..3991eb9ab3 100644 --- a/.github/workflows/util-build.yml +++ b/.github/workflows/util-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/verkle-build.yml b/.github/workflows/verkle-build.yml index b680510274..f22648d0b4 100644 --- a/.github/workflows/verkle-build.yml +++ b/.github/workflows/verkle-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/vm-pr.yml b/.github/workflows/vm-pr.yml index 15cd31d8c1..ce43a8ee07 100644 --- a/.github/workflows/vm-pr.yml +++ b/.github/workflows/vm-pr.yml @@ -1,7 +1,7 @@ name: VM on: - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: diff --git a/.github/workflows/wallet-build.yml b/.github/workflows/wallet-build.yml index 9a9ecb8022..011e18d0e4 100644 --- a/.github/workflows/wallet-build.yml +++ b/.github/workflows/wallet-build.yml @@ -3,8 +3,8 @@ on: push: branches: [master, develop] tags: ['*'] - pull_request: - types: [opened, reopened, synchronize] + #pull_request: + # types: [opened, reopened, synchronize] workflow_dispatch: env: From c5134d6316db905e796502b9348cb983f048fb22 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:41:43 +0200 Subject: [PATCH 03/10] test --- .github/workflows/build-monorepo.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-monorepo.yml b/.github/workflows/build-monorepo.yml index effe8658e3..639632de72 100644 --- a/.github/workflows/build-monorepo.yml +++ b/.github/workflows/build-monorepo.yml @@ -34,6 +34,4 @@ jobs: with: path: '.' key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' - restore-keys: '${{ runner.os }}-node-18' - - - run: npm i \ No newline at end of file + restore-keys: '${{ runner.os }}-node-18' \ No newline at end of file From d62eeeb288d3cbf12396393211843174268e6180 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:42:33 +0200 Subject: [PATCH 04/10] test --- .github/workflows/block-build.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/block-build.yml b/.github/workflows/block-build.yml index de61e9564b..83d81229c8 100644 --- a/.github/workflows/block-build.yml +++ b/.github/workflows/block-build.yml @@ -24,11 +24,23 @@ jobs: strategy: matrix: node-version: [18] - needs: build-monorepo steps: - - name: 'Cache build' - - uses: 'actions/cache@v3' + - uses: actions/checkout@v4 with: - path: '.' - key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' - restore-keys: '${{ runner.os }}-node-18' \ No newline at end of file + submodules: recursive + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - run: npm ci --omit=peer + working-directory: ${{github.workspace}} + + - run: npm run lint + - run: npm run coverage + - uses: codecov/codecov-action@v3 + with: + files: ${{ env.cwd }}/coverage/lcov.info + flags: block From 11b4c0ad120caff11bd7491f57ca453da2a58bfe Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:43:21 +0200 Subject: [PATCH 05/10] fix --- .github/workflows/build-monorepo.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-monorepo.yml b/.github/workflows/build-monorepo.yml index 639632de72..4df56fb6bd 100644 --- a/.github/workflows/build-monorepo.yml +++ b/.github/workflows/build-monorepo.yml @@ -19,18 +19,18 @@ jobs: node-version: [18] steps: - name: Checkout monorepo - - uses: actions/checkout@v4 + uses: actions/checkout@v4 with: submodules: recursive - name: Setup node - - uses: actions/setup-node@v4 + uses: actions/setup-node@v4 with: node-version: 18 cache: 'npm' - name: 'Cache build' - - uses: 'actions/cache@v3' + uses: 'actions/cache@v3' with: path: '.' key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' From 8de0d64d9ad3d30aab3d99c0c0eb697761d835f5 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:45:54 +0200 Subject: [PATCH 06/10] setup block --- .github/workflows/block-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/block-build.yml b/.github/workflows/block-build.yml index 83d81229c8..a15791dda5 100644 --- a/.github/workflows/block-build.yml +++ b/.github/workflows/block-build.yml @@ -20,6 +20,7 @@ concurrency: jobs: test-block: + needs: 'build-monorepo' runs-on: ubuntu-latest strategy: matrix: From 2125671b671512a05ea1068669866afc38192dba Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:46:01 +0200 Subject: [PATCH 07/10] setup block --- .github/workflows/block-build.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/block-build.yml b/.github/workflows/block-build.yml index a15791dda5..8064a13cc7 100644 --- a/.github/workflows/block-build.yml +++ b/.github/workflows/block-build.yml @@ -26,22 +26,9 @@ jobs: matrix: node-version: [18] steps: - - uses: actions/checkout@v4 + - name: 'Load cache' + uses: 'actions/cache@v3' with: - submodules: recursive - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - run: npm ci --omit=peer - working-directory: ${{github.workspace}} - - - run: npm run lint - - run: npm run coverage - - uses: codecov/codecov-action@v3 - with: - files: ${{ env.cwd }}/coverage/lcov.info - flags: block + path: '.' + key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' + restore-keys: '${{ runner.os }}-node-18' \ No newline at end of file From 3262b79017290a9679812f2e3e3c63806442f2c3 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:47:50 +0200 Subject: [PATCH 08/10] test --- .github/workflows/build-monorepo.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-monorepo.yml b/.github/workflows/build-monorepo.yml index 4df56fb6bd..37305e73c3 100644 --- a/.github/workflows/build-monorepo.yml +++ b/.github/workflows/build-monorepo.yml @@ -14,9 +14,6 @@ concurrency: jobs: build-monorepo: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18] steps: - name: Checkout monorepo uses: actions/checkout@v4 @@ -32,6 +29,6 @@ jobs: - name: 'Cache build' uses: 'actions/cache@v3' with: - path: '.' - key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' - restore-keys: '${{ runner.os }}-node-18' \ No newline at end of file + path: . + key: ${{ runner.os }}-node-18-${{ git rev-parse HEAD }} + restore-keys: ${{ runner.os }}-node-18- \ No newline at end of file From 0b93024c420453d067782eb9f38b2a88f48926d1 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:48:44 +0200 Subject: [PATCH 09/10] test --- .github/workflows/build-monorepo.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/build-monorepo.yml b/.github/workflows/build-monorepo.yml index 37305e73c3..fe4abffc82 100644 --- a/.github/workflows/build-monorepo.yml +++ b/.github/workflows/build-monorepo.yml @@ -25,10 +25,3 @@ jobs: with: node-version: 18 cache: 'npm' - - - name: 'Cache build' - uses: 'actions/cache@v3' - with: - path: . - key: ${{ runner.os }}-node-18-${{ git rev-parse HEAD }} - restore-keys: ${{ runner.os }}-node-18- \ No newline at end of file From 99c72e63d4025d56dddf778b54d5565735ca585b Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 15 Aug 2024 00:50:37 +0200 Subject: [PATCH 10/10] test --- .github/workflows/build-monorepo.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-monorepo.yml b/.github/workflows/build-monorepo.yml index fe4abffc82..8386a07372 100644 --- a/.github/workflows/build-monorepo.yml +++ b/.github/workflows/build-monorepo.yml @@ -25,3 +25,10 @@ jobs: with: node-version: 18 cache: 'npm' + + - name: 'Cache build' + uses: 'actions/cache@v3' + with: + path: ~ + key: ${{ runner.os }}-node-18-${{ git rev-parse HEAD }} + restore-keys: ${{ runner.os }}-node-18- \ No newline at end of file