Commit b3ebaf76 authored by Ben Boeckel's avatar Ben Boeckel

gitlab-ci: add port of buildbot as gitlab-ci

parent afdc70cc
Pipeline #148446 passed with stages
in 6 minutes and 50 seconds
before_script:
- apt-get update -yqq
- export CARGO_HOME=.cargo-cache
- rustc --version
- cargo --version
.rust_tags: &rust_tags
- rust
- docker
- ghostflow
- linux
.cargo_update: &cargo_update
- cargo generate-lockfile $GENERATE_LOCKFILE_ARGS
- cargo fetch --locked
.cargo_build: &cargo_build
- cargo build $CARGO_BUILD_FROZEN --all --verbose
- cargo test --frozen --all --no-run --verbose
.cargo_test: &cargo_test
- apt-get install -yqq --no-install-recommends git
- git config --global user.name "Ghostflow Testing"
- git config --global user.email "ghostflow@example.invalid"
- cargo test --frozen --all --verbose
.rust_minimum: &rust_minimum
image: "rust:1.32.0"
variables:
# Not supported yet here? If updating to a version where this works,
# remove this variable.
#CARGO_BUILD_FROZEN: --frozen
CARGO_UPDATE_POLICY: newest
.rust_stable: &rust_stable
image: "rust:latest"
variables:
CARGO_BUILD_FROZEN: --frozen
CARGO_UPDATE_POLICY: newest
.rust_nightly: &rust_nightly
extends: .rust_stable
image: "rustlang/rust:nightly"
.cargo_fetch_job: &cargo_fetch_job
stage: prepare
tags: *rust_tags
script: *cargo_update
artifacts:
expire_in: 60m
paths:
- .cargo-cache
- Cargo.lock
cache:
key: cargo-cache-$CARGO_UPDATE_POLICY
paths:
- .cargo-cache
interruptible: true
.cargo_build_job: &cargo_build_job
stage: build
tags: *rust_tags
script: *cargo_build
artifacts:
expire_in: 60m
paths:
- .cargo-cache
- Cargo.lock
- target
cache:
key: build-cache-$CI_JOB_NAME
paths:
- target
interruptible: true
.cargo_test_job: &cargo_test_job
stage: test
tags: *rust_tags
script: *cargo_test
interruptible: true
stages:
- prepare
- build
- test
prepare:cargo-cache-newest:
<<:
- *cargo_fetch_job
- *rust_stable
prepare:cargo-cache-mindeps:
<<:
- *cargo_fetch_job
- *rust_nightly
variables:
GENERATE_LOCKFILE_ARGS: "-Z minimal-versions"
CARGO_UPDATE_POLICY: mindeps
.cargo_cache_newest: &cargo_cache_newest
dependencies:
- prepare:cargo-cache-newest
needs:
- prepare:cargo-cache-newest
build:cargo-clippy:
<<:
- *cargo_build_job
- *rust_stable
- *cargo_cache_newest
script:
- rustup component add clippy
- cargo clippy --frozen --tests --all --verbose -- -D warnings
build:cargo-minimum:
<<:
- *cargo_build_job
- *rust_minimum
- *cargo_cache_newest
test:cargo-minimum:
<<:
- *cargo_test_job
- *rust_minimum
dependencies:
- build:cargo-minimum
needs:
- build:cargo-minimum
build:cargo-stable:
<<:
- *cargo_build_job
- *rust_stable
- *cargo_cache_newest
test:cargo-stable:
<<:
- *cargo_test_job
- *rust_stable
dependencies:
- build:cargo-stable
needs:
- build:cargo-stable
build:cargo-nightly:
<<:
- *cargo_build_job
- *rust_nightly
- *cargo_cache_newest
test:cargo-nightly:
<<:
- *cargo_test_job
- *rust_nightly
dependencies:
- build:cargo-nightly
needs:
- build:cargo-nightly
build:cargo-mindeps:
<<:
- *cargo_build_job
- *rust_minimum
dependencies:
- prepare:cargo-cache-mindeps
needs:
- prepare:cargo-cache-mindeps
test:cargo-mindeps:
<<:
- *cargo_test_job
- *rust_minimum
dependencies:
- build:cargo-mindeps
needs:
- build:cargo-mindeps
prepare:git:
image: "rust:latest"
stage: prepare
tags: *rust_tags
script:
- export GIT_ROOT=$PWD/git/root
- "[ -d git ] || git clone https://github.com/git/git.git git/src"
- pushd git/src
- git reset --hard
- git pull
- make prefix=$GIT_ROOT NO_GETTEXT=1 NO_TCLTK=1 NO_INSTALL_HARDLINKS=1 -j`nproc` install
- popd
variables:
GIT_STRATEGY: none
artifacts:
expire_in: 60m
paths:
- git/root
cache:
key: git-master
paths:
- git/src
interruptible: true
test:git-master:
<<:
- *cargo_test_job
- *rust_stable
script:
- git config --global user.name "Ghostflow Testing"
- git config --global user.email "ghostflow@example.invalid"
- PATH=$PWD/git/root/bin:$PATH cargo test --frozen --all --verbose
dependencies:
- prepare:git
- build:cargo-stable
needs:
- prepare:git
- build:cargo-stable
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment