mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(ci): refactor code to build image used in several workflows (#13304)
This commit is contained in:
36
.github/workflows/hive.yml
vendored
36
.github/workflows/hive.yml
vendored
@ -17,38 +17,10 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare-reth:
|
prepare-reth:
|
||||||
if: github.repository == 'paradigmxyz/reth'
|
uses: ./.github/workflows/prepare-reth.yml
|
||||||
timeout-minutes: 45
|
with:
|
||||||
runs-on:
|
image_tag: ghcr.io/paradigmxyz/reth:latest
|
||||||
group: Reth
|
binary_name: reth
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: mkdir artifacts
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
cache-on-failure: true
|
|
||||||
- name: Build reth
|
|
||||||
run: |
|
|
||||||
cargo build --features asm-keccak --profile hivetests --bin reth --locked
|
|
||||||
mkdir dist && cp ./target/hivetests/reth ./dist/reth
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and export reth image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: .github/assets/hive/Dockerfile
|
|
||||||
tags: ghcr.io/paradigmxyz/reth:latest
|
|
||||||
outputs: type=docker,dest=./artifacts/reth_image.tar
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Upload reth image
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./artifacts
|
|
||||||
|
|
||||||
prepare-hive:
|
prepare-hive:
|
||||||
if: github.repository == 'paradigmxyz/reth'
|
if: github.repository == 'paradigmxyz/reth'
|
||||||
|
|||||||
38
.github/workflows/kurtosis-op.yml
vendored
38
.github/workflows/kurtosis-op.yml
vendored
@ -17,38 +17,12 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare-reth:
|
prepare-reth:
|
||||||
if: github.repository == 'paradigmxyz/reth'
|
uses: ./.github/workflows/prepare-reth.yml
|
||||||
timeout-minutes: 45
|
with:
|
||||||
runs-on:
|
image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
|
||||||
group: Reth
|
binary_name: op-reth
|
||||||
steps:
|
cargo_features: optimism,asm-keccak
|
||||||
- uses: actions/checkout@v4
|
cargo_package: crates/optimism/bin/Cargo.toml
|
||||||
- run: mkdir artifacts
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
cache-on-failure: true
|
|
||||||
- name: Build reth
|
|
||||||
run: |
|
|
||||||
cargo build --features optimism,asm-keccak --profile hivetests --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml --locked
|
|
||||||
mkdir dist && cp ./target/hivetests/op-reth ./dist/reth
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and export reth image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: .github/assets/hive/Dockerfile
|
|
||||||
tags: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
|
|
||||||
outputs: type=docker,dest=./artifacts/reth_image.tar
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Upload reth image
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./artifacts
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|||||||
36
.github/workflows/kurtosis.yml
vendored
36
.github/workflows/kurtosis.yml
vendored
@ -17,38 +17,10 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare-reth:
|
prepare-reth:
|
||||||
if: github.repository == 'paradigmxyz/reth'
|
uses: ./.github/workflows/prepare-reth.yml
|
||||||
timeout-minutes: 45
|
with:
|
||||||
runs-on:
|
image_tag: ghcr.io/paradigmxyz/reth:kurtosis-ci
|
||||||
group: Reth
|
binary_name: reth
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: mkdir artifacts
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
cache-on-failure: true
|
|
||||||
- name: Build reth
|
|
||||||
run: |
|
|
||||||
cargo build --features asm-keccak --profile hivetests --bin reth --locked
|
|
||||||
mkdir dist && cp ./target/hivetests/reth ./dist/reth
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and export reth image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: .github/assets/hive/Dockerfile
|
|
||||||
tags: ghcr.io/paradigmxyz/reth:kurtosis-ci
|
|
||||||
outputs: type=docker,dest=./artifacts/reth_image.tar
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Upload reth image
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./artifacts
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|||||||
66
.github/workflows/prepare-reth.yml
vendored
Normal file
66
.github/workflows/prepare-reth.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
name: Prepare Reth Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
image_tag:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
description: "Docker image tag to use"
|
||||||
|
binary_name:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: "reth"
|
||||||
|
description: "Binary name to build (reth or op-reth)"
|
||||||
|
cargo_features:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: "asm-keccak"
|
||||||
|
description: "Cargo features to enable"
|
||||||
|
cargo_package:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
description: "Optional cargo package path"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare-reth:
|
||||||
|
if: github.repository == 'paradigmxyz/reth'
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on:
|
||||||
|
group: Reth
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: mkdir artifacts
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
cache-on-failure: true
|
||||||
|
|
||||||
|
- name: Build reth
|
||||||
|
run: |
|
||||||
|
CARGO_CMD="cargo build --features ${{ inputs.cargo_features }} --profile hivetests --bin ${{ inputs.binary_name }} --locked"
|
||||||
|
if [ -n "${{ inputs.cargo_package }}" ]; then
|
||||||
|
CARGO_CMD="$CARGO_CMD --manifest-path ${{ inputs.cargo_package }}"
|
||||||
|
fi
|
||||||
|
$CARGO_CMD
|
||||||
|
mkdir dist && cp ./target/hivetests/${{ inputs.binary_name }} ./dist/reth
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build and export reth image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: .github/assets/hive/Dockerfile
|
||||||
|
tags: ${{ inputs.image_tag }}
|
||||||
|
outputs: type=docker,dest=./artifacts/reth_image.tar
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Upload reth image
|
||||||
|
id: upload
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: artifacts
|
||||||
|
path: ./artifacts
|
||||||
Reference in New Issue
Block a user