diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..db593a592 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +#Adapted from https://users.rust-lang.org/t/my-gitlab-config-docs-tests/16396 + +image: 'sigp/lighthouse:latest' + +stages: + - test + - doc + +variables: + CARGO_HOME: /cache/cargocache + +check-fmt: + stage: test + script: + - cargo build --manifest-path protos/Cargo.toml + - cargo fmt --all -- --check + +test-dev: + stage: test + script: + - cargo test --verbose --all + +test-release: + stage: test + script: + - cargo test --verbose --all --release + +pages: + stage: doc + script: + - cargo doc --no-deps + - mv target/doc public + # - echo '' > public/index.html + artifacts: + paths: + - public + only: + - master + +cache: + paths: + - target/ diff --git a/Dockerfile b/Dockerfile index 6691efa97..e693c91a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,8 @@ RUN git clone https://github.com/google/protobuf.git && \ rm -r protobuf -RUN mkdir /cargocache && chmod -R ugo+rwX /cargocache +RUN mkdir -p /cache/cargocache && chmod -R ugo+rwX /cache/cargocache -ENV CARGO_HOME /cargocache +ENV CARGO_HOME /cache/cargocache RUN rustup component add rustfmt clippy diff --git a/Jenkinsfile b/Jenkinsfile index 11cbf0abe..3b022551e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { dockerfile { filename 'Dockerfile' - args '-v cargo-cache:/cargocache:rw -e "CARGO_HOME=/cargocache"' + args '-v cargo-cache:/cache/cargocache:rw -e "CARGO_HOME=/cache/cargocache"' } } stages {