Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed Jul 11, 2024
0 parents commit 2b774a8
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Earthly +build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions:
packages: write
pages: write
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.14
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run build
run: earthly +build
71 changes: 71 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
VERSION 0.8

namada:
FROM rust:1.78.0-bookworm

ARG rocksdb_version=8.10.0
ARG gaia_version=15.2.0
ARG cometbft_version=0.37.2
ARG wasm_opt_version=118

RUN apt-get update -y
RUN apt-get install -y protobuf-compiler
RUN apt-get install -y build-essential
RUN apt-get install -y clang-tools clang
RUN apt-get install -y libudev-dev
RUN apt-get install -y libssl-dev
RUN apt-get install -y pkg-config
RUN apt-get install -y gcc
RUN apt-get install -y parallel

RUN rustup toolchain install 1.78.0-x86_64-unknown-linux-gnu --no-self-update --component clippy,rustfmt,rls,rust-analysis,rust-docs,rust-src
RUN rustup toolchain install nightly-2024-05-15-x86_64-unknown-linux-gnu --no-self-update --component clippy,rustfmt,rls,rust-analysis,rust-docs,rust-src
RUN rustup target add wasm32-unknown-unknown
RUN rustup default 1.78.0-x86_64-unknown-linux-gnu

# download masp artifacts
RUN mkdir -p .masp-params
RUN curl -o .masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true
RUN curl -o .masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true
RUN curl -o .masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true

# install cargo nextest
RUN cargo install cargo-nextest --locked

# install sccache
RUN cargo install sccache --locked

# install cargo sweep
RUN cargo install cargo-sweep --locked

# install llvm-cov
RUN cargo install cargo-llvm-cov --locked
RUN cargo +nightly-2024-05-15-x86_64 install cargo-llvm-cov --locked

# install rocksdb
GIT CLONE --branch v$rocksdb_version [email protected]:facebook/rocksdb.git rocksdb
RUN cd rocksdb && make shared_lib
RUN echo /rocksdb | tee /etc/ld.so.conf.d/rocksdb.conf
RUN ldconfig

# install mold
RUN curl -o mold.tar.gz -LO https://github.com/rui314/mold/releases/download/v2.32.1/mold-2.32.1-x86_64-linux.tar.gz
RUN tar --strip-components 2 -xvzf mold.tar.gz mold-2.32.1-x86_64-linux/bin/mold
RUN mv mold /usr/local/bin

# download gaia
RUN curl -o gaiad -LO https://github.com/cosmos/gaia/releases/download/v${gaia_version}/gaiad-v${gaia_version}-linux-amd64
RUN mv gaiad /usr/local/bin

# download cometbft
RUN curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v${cometbft_version}/cometbft_${cometbft_version}_linux_amd64.tar.gz
RUN tar -xvzf cometbft.tar.gz
RUN mv cometbft /usr/local/bin

# download wasm-opt
RUN curl -o binaryen.tar.gz -LO https://github.com/WebAssembly/binaryen/releases/download/version_${wasm_opt_version}/binaryen-version_${wasm_opt_version}-x86_64-linux.tar.gz
RUN tar --strip-components 2 -xvzf binaryen.tar.gz binaryen-version_${wasm_opt_version}/bin/wasm-opt
RUN mv wasm-opt /usr/local/bin

build:
BUILD +namada

0 comments on commit 2b774a8

Please sign in to comment.