forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (60 loc) · 1.87 KB
/
prepare-reth.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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