Merge pull request #366 from sigp/gitlab-ci

Implement GitLab CI
This commit is contained in:
Paul Hauner 2019-05-07 16:11:03 +10:00 committed by GitHub
commit 00f85a0324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 3 deletions

42
.gitlab-ci.yml Normal file
View File

@ -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 '<meta http-equiv="refresh" content="0; url={{ LIBRARY NAME }}">' > public/index.html
artifacts:
paths:
- public
only:
- master
cache:
paths:
- target/

View File

@ -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

2
Jenkinsfile vendored
View File

@ -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 {