mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Update docker file, use makefile in CI
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
tests/ef_tests/eth2.0-spec-tests
|
||||||
|
target/
|
||||||
@@ -10,7 +10,7 @@ jobs:
|
|||||||
- name: Get latest version of stable Rust
|
- name: Get latest version of stable Rust
|
||||||
run: rustup update stable
|
run: rustup update stable
|
||||||
- name: Check formatting with cargo fmt
|
- name: Check formatting with cargo fmt
|
||||||
run: cargo fmt --all -- --check
|
run: make cargo-fmt
|
||||||
release-tests-ubuntu:
|
release-tests-ubuntu:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: cargo-fmt
|
needs: cargo-fmt
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- name: Install ganache-cli
|
- name: Install ganache-cli
|
||||||
run: sudo npm install -g ganache-cli
|
run: sudo npm install -g ganache-cli
|
||||||
- name: Run tests in release
|
- name: Run tests in release
|
||||||
run: cargo test --release --all
|
run: make test-release
|
||||||
debug-tests-ubuntu:
|
debug-tests-ubuntu:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: cargo-fmt
|
needs: cargo-fmt
|
||||||
@@ -34,9 +34,19 @@ jobs:
|
|||||||
needs: cargo-fmt
|
needs: cargo-fmt
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Download test vectors
|
- name: Run eth2.0-spec-tests with and without fake_crypto
|
||||||
run: make make-ef-tests
|
run: make test-ef
|
||||||
- name: Run eth2.0-spec-tests without fake_crypto
|
dockerfile-ubuntu:
|
||||||
run: cargo test --manifest-path tests/ef_tests/Cargo.toml --release --features ef_tests
|
runs-on: ubuntu-latest
|
||||||
- name: Run eth2.0-spec-tests with fake_crypto
|
needs: cargo-fmt
|
||||||
run: cargo test --manifest-path tests/ef_tests/Cargo.toml --release --features ef_tests,fake_crypto
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Build the root Dockerfile
|
||||||
|
run: docker build .
|
||||||
|
install-ubuntu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: cargo-fmt
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Build using the root Makefile
|
||||||
|
run: make
|
||||||
29
Dockerfile
29
Dockerfile
@@ -1,29 +1,4 @@
|
|||||||
FROM rust:latest
|
FROM rust:latest
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y clang libclang-dev cmake build-essential git unzip autoconf libtool awscli software-properties-common
|
COPY . lighthouse
|
||||||
|
RUN cd lighthouse && cargo install --path lighthouse
|
||||||
RUN add-apt-repository -y ppa:git-core/ppa
|
|
||||||
|
|
||||||
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
|
||||||
|
|
||||||
RUN apt-get install -y git-lfs
|
|
||||||
|
|
||||||
RUN git clone https://github.com/google/protobuf.git && \
|
|
||||||
cd protobuf && \
|
|
||||||
./autogen.sh && \
|
|
||||||
./configure && \
|
|
||||||
make && \
|
|
||||||
make install && \
|
|
||||||
ldconfig && \
|
|
||||||
make clean && \
|
|
||||||
cd .. && \
|
|
||||||
rm -r protobuf
|
|
||||||
|
|
||||||
RUN apt-get install -y nodejs npm
|
|
||||||
RUN npm install -g ganache-cli --unsafe-perm
|
|
||||||
|
|
||||||
RUN mkdir -p /cache/cargocache && chmod -R ugo+rwX /cache/cargocache
|
|
||||||
|
|
||||||
ENV CARGO_HOME /cache/cargocache
|
|
||||||
|
|
||||||
RUN rustup component add rustfmt clippy
|
|
||||||
|
|||||||
29
Makefile
29
Makefile
@@ -5,24 +5,37 @@ EF_TESTS = "tests/ef_tests"
|
|||||||
# Builds the entire workspace in release (optimized).
|
# Builds the entire workspace in release (optimized).
|
||||||
#
|
#
|
||||||
# Binaries will most likely be found in `./target/release`
|
# Binaries will most likely be found in `./target/release`
|
||||||
release:
|
install:
|
||||||
cargo build --release --all
|
cargo install --path lighthouse --force
|
||||||
|
|
||||||
# Runs the full workspace tests, without downloading any additional test
|
# Runs the full workspace tests in **release**, without downloading any additional
|
||||||
|
# test vectors.
|
||||||
|
test-release:
|
||||||
|
cargo test --all --release --exclude ef_tests
|
||||||
|
|
||||||
|
# Runs the full workspace tests in **debug**, without downloading any additional test
|
||||||
# vectors.
|
# vectors.
|
||||||
test:
|
test-debug:
|
||||||
cargo test --all --all-features --release --exclude ef_tests
|
cargo test --all --exclude ef_tests
|
||||||
|
|
||||||
|
# Runs cargo-fmt (linter).
|
||||||
|
cargo-fmt:
|
||||||
|
cargo fmt --all -- --check
|
||||||
|
|
||||||
# only run the ef-test vectors
|
# Runs only the ef-test vectors.
|
||||||
run-ef-tests:
|
run-ef-tests:
|
||||||
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests"
|
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests"
|
||||||
|
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests,fake_crypto"
|
||||||
|
|
||||||
|
# Downloads and runs the EF test vectors.
|
||||||
test-ef: make-ef-tests run-ef-tests
|
test-ef: make-ef-tests run-ef-tests
|
||||||
|
|
||||||
# Runs the entire test suite, downloading test vectors if required.
|
# Runs the full workspace tests in release, without downloading any additional
|
||||||
test-full: test test-ef
|
# test vectors.
|
||||||
|
test: test-release
|
||||||
|
|
||||||
|
# Runs the entire test suite, downloading test vectors if required.
|
||||||
|
test-full: cargo-fmt test-release test-debug test-ef
|
||||||
|
|
||||||
# Runs the makefile in the `ef_tests` repo.
|
# Runs the makefile in the `ef_tests` repo.
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user