Update docker file, use makefile in CI

This commit is contained in:
Paul Hauner
2019-11-23 10:14:26 +11:00
parent be7346d3ea
commit 6b0b76edf4
4 changed files with 44 additions and 44 deletions

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
tests/ef_tests/eth2.0-spec-tests
target/

View File

@@ -10,7 +10,7 @@ jobs:
- name: Get latest version of stable Rust
run: rustup update stable
- name: Check formatting with cargo fmt
run: cargo fmt --all -- --check
run: make cargo-fmt
release-tests-ubuntu:
runs-on: ubuntu-latest
needs: cargo-fmt
@@ -19,7 +19,7 @@ jobs:
- name: Install ganache-cli
run: sudo npm install -g ganache-cli
- name: Run tests in release
run: cargo test --release --all
run: make test-release
debug-tests-ubuntu:
runs-on: ubuntu-latest
needs: cargo-fmt
@@ -34,9 +34,19 @@ jobs:
needs: cargo-fmt
steps:
- uses: actions/checkout@v1
- name: Download test vectors
run: make make-ef-tests
- name: Run eth2.0-spec-tests without fake_crypto
run: cargo test --manifest-path tests/ef_tests/Cargo.toml --release --features ef_tests
- name: Run eth2.0-spec-tests with fake_crypto
run: cargo test --manifest-path tests/ef_tests/Cargo.toml --release --features ef_tests,fake_crypto
- name: Run eth2.0-spec-tests with and without fake_crypto
run: make test-ef
dockerfile-ubuntu:
runs-on: ubuntu-latest
needs: cargo-fmt
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

View File

@@ -1,29 +1,4 @@
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
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
COPY . lighthouse
RUN cd lighthouse && cargo install --path lighthouse

View File

@@ -5,24 +5,37 @@ EF_TESTS = "tests/ef_tests"
# Builds the entire workspace in release (optimized).
#
# Binaries will most likely be found in `./target/release`
release:
cargo build --release --all
install:
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.
test:
cargo test --all --all-features --release --exclude ef_tests
test-debug:
cargo test --all --exclude ef_tests
# Runs cargo-fmt (linter).
cargo-fmt:
cargo fmt --all -- --check
# only run the ef-test vectors
run-ef-tests:
# Runs only the ef-test vectors.
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,fake_crypto"
# Downloads and runs the EF test vectors.
test-ef: make-ef-tests run-ef-tests
# Runs the entire test suite, downloading test vectors if required.
test-full: test test-ef
# Runs the full workspace tests in release, without downloading any additional
# 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.
#