2019-04-18 22:23:11 +00:00
|
|
|
stages:
|
2019-09-07 16:35:10 +00:00
|
|
|
- optional-builds
|
|
|
|
- check-compile
|
2019-04-27 15:38:28 +00:00
|
|
|
- post-build
|
2019-04-18 22:23:11 +00:00
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
# Our own git fetch command like https://gitlab.com/gitlab-org/gitlab-runner/blob/master/shells/abstract.go
|
|
|
|
# speeds up building because we skip the git clean and don't need any gitlab caches.
|
2019-04-18 22:23:11 +00:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
before_script:
|
2019-04-27 15:38:28 +00:00
|
|
|
- mkdir -p /cache/veloren
|
2019-04-29 14:05:53 +00:00
|
|
|
- rm -rf /cache/veloren/bin
|
2019-04-27 15:38:28 +00:00
|
|
|
- cd /cache/veloren
|
2019-04-18 22:23:11 +00:00
|
|
|
- if [ -d .git ]; then
|
|
|
|
echo "is git dir";
|
|
|
|
else
|
2019-04-27 15:38:28 +00:00
|
|
|
git clone $CI_REPOSITORY_URL . ;
|
2019-04-18 22:23:11 +00:00
|
|
|
fi;
|
2019-04-29 14:05:53 +00:00
|
|
|
- mkdir -p /cache/veloren/bin
|
2019-04-18 22:23:11 +00:00
|
|
|
- rm -f .git/index.lock
|
|
|
|
- rm -f .git/shallow.lock
|
|
|
|
- rm -f .git/HEAD.lock
|
|
|
|
- rm -f .git/hocks/post-checkout
|
|
|
|
- git remote set-url origin $CI_REPOSITORY_URL
|
|
|
|
- git fetch origin --prune +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
|
|
|
|
- git checkout -f -q $CI_COMMIT_SHA
|
|
|
|
- if [ ! -z "${SOURCE_PROJECT}" -a "${SOURCE_PROJECT}" != " " ]; then
|
2019-04-27 15:38:28 +00:00
|
|
|
echo "THIS SEEMS TO BE A MERGE PIPELINE FROM ${SOURCE_PROJECT}/${SOURCE_BRANCH}";
|
|
|
|
git pull "https://gitlab.com/${SOURCE_PROJECT}/veloren.git" "${SOURCE_BRANCH}";
|
2019-04-18 22:23:11 +00:00
|
|
|
fi;
|
2019-05-13 13:45:21 +00:00
|
|
|
- git lfs install;
|
|
|
|
- git lfs fetch;
|
|
|
|
- git lfs checkout;
|
2019-04-18 22:23:11 +00:00
|
|
|
- git status
|
2019-07-06 18:03:29 +00:00
|
|
|
- rustup -v show
|
2019-04-18 22:23:11 +00:00
|
|
|
- if [ -d target ]; then
|
2019-04-27 15:38:28 +00:00
|
|
|
ls -la target;
|
2019-04-18 22:23:11 +00:00
|
|
|
fi;
|
|
|
|
|
2019-09-07 16:35:10 +00:00
|
|
|
#############
|
|
|
|
# Optional build
|
|
|
|
#############
|
|
|
|
|
|
|
|
.optional: &optional
|
|
|
|
stage: optional-builds
|
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
except:
|
|
|
|
- schedules
|
|
|
|
when: manual
|
|
|
|
|
|
|
|
optional:linux-debug:
|
|
|
|
<<: *optional
|
|
|
|
script:
|
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build)
|
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build)
|
|
|
|
- rm -r -f optional-build
|
|
|
|
- mkdir optional-build
|
|
|
|
- cp target/debug/veloren-server-cli optional-build
|
|
|
|
- cp target/debug/veloren-voxygen optional-build
|
|
|
|
- cp -r assets optional-build/
|
|
|
|
- tar -cvjSf bin/optional-linux-debug.tar.bz2 optional-build
|
|
|
|
- cp bin/optional-linux-debug.tar.bz2 $CI_PROJECT_DIR
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- optional-linux-debug.tar.bz2
|
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
optional:windows-debug:
|
|
|
|
<<: *optional
|
|
|
|
script:
|
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu)
|
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu)
|
|
|
|
- rm -r -f optional-build
|
|
|
|
- mkdir optional-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe optional-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe optional-build
|
|
|
|
- cp -r assets optional-build/
|
|
|
|
- zip -r bin/optional-windows-debug.zip optional-build
|
|
|
|
- cp bin/optional-windows-debug.zip $CI_PROJECT_DIR
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- optional-windows-debug.zip
|
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
#############
|
|
|
|
# Optional release build
|
|
|
|
#############
|
|
|
|
|
|
|
|
.optional-release: &optional-release
|
|
|
|
stage: optional-builds
|
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
except:
|
|
|
|
- schedules
|
|
|
|
when: manual
|
|
|
|
|
|
|
|
optional-release:linux-debug:
|
|
|
|
<<: *optional-release
|
|
|
|
script:
|
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build --release)
|
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build --release)
|
|
|
|
- rm -r -f optional-release-build
|
|
|
|
- mkdir optional-release-build
|
|
|
|
- cp target/debug/veloren-server-cli optional-release-build
|
|
|
|
- cp target/debug/veloren-voxygen optional-release-build
|
|
|
|
- cp -r assets optional-release-build/
|
|
|
|
- tar -cvjSf bin/optional-release-linux-debug.tar.bz2 optional-release-build
|
|
|
|
- cp bin/optional-release-linux-debug.tar.bz2 $CI_PROJECT_DIR
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- optional-release-linux-debug.tar.bz2
|
|
|
|
expire_in: 1 month
|
|
|
|
|
|
|
|
optional-release:windows-debug:
|
|
|
|
<<: *optional-release
|
|
|
|
script:
|
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu)
|
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu)
|
|
|
|
- rm -r -f optional-release-build
|
|
|
|
- mkdir optional-release-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe optional-release-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe optional-release-build
|
|
|
|
- cp -r assets optional-release-build/
|
|
|
|
- zip -r bin/optional-release-windows-debug.zip optional-release-build
|
|
|
|
- cp bin/optional-release-windows-debug.zip $CI_PROJECT_DIR
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- optional-release-windows-debug.zip
|
|
|
|
expire_in: 1 month
|
|
|
|
|
2019-04-27 15:38:28 +00:00
|
|
|
#############
|
2019-09-04 23:03:49 +00:00
|
|
|
# CHECK
|
2019-04-27 15:38:28 +00:00
|
|
|
#############
|
2019-04-18 22:23:11 +00:00
|
|
|
|
2019-09-04 23:03:49 +00:00
|
|
|
check-voxygen:
|
2019-09-07 16:35:10 +00:00
|
|
|
stage: check-compile
|
2019-04-27 15:38:28 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
2019-09-04 05:13:18 +00:00
|
|
|
- (cd voxygen && RUSTFLAGS="-D warnings" cargo check)
|
2019-04-18 22:23:11 +00:00
|
|
|
|
2019-09-04 23:03:49 +00:00
|
|
|
check-server-cli:
|
2019-09-07 16:35:10 +00:00
|
|
|
stage: check-compile
|
2019-04-27 15:38:28 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
2019-09-04 05:13:18 +00:00
|
|
|
- (cd server-cli && RUSTFLAGS="-D warnings" cargo check)
|
2019-04-18 22:23:11 +00:00
|
|
|
|
2019-04-27 15:38:28 +00:00
|
|
|
#############
|
2019-09-07 16:35:10 +00:00
|
|
|
# POST-BUILD
|
2019-04-27 15:38:28 +00:00
|
|
|
#############
|
|
|
|
|
2019-04-18 22:23:11 +00:00
|
|
|
unittests:
|
2019-09-07 16:35:10 +00:00
|
|
|
stage: post-build
|
2019-04-27 15:38:28 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
|
|
|
- cargo test
|
|
|
|
|
2019-04-27 15:38:28 +00:00
|
|
|
benchmarktests:
|
2019-09-07 16:35:10 +00:00
|
|
|
stage: post-build
|
2019-04-27 15:38:28 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-04-27 15:38:28 +00:00
|
|
|
script:
|
|
|
|
- cargo bench
|
|
|
|
allow_failure: true
|
|
|
|
|
|
|
|
clean-code:
|
|
|
|
stage: post-build
|
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-04-27 15:38:28 +00:00
|
|
|
script:
|
|
|
|
- cargo fmt --all -- --check
|
|
|
|
|
2019-04-29 14:05:53 +00:00
|
|
|
# # Coverage needs to be disabled until an issue in the Rust compiler is fixed
|
|
|
|
# # https://github.com/rust-lang/rust/issues/58375
|
|
|
|
# coverage:
|
|
|
|
# stage: post-build
|
|
|
|
# image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
# tags:
|
|
|
|
# - veloren-docker
|
|
|
|
# script:
|
|
|
|
# - cargo tarpaulin --all
|
|
|
|
# allow_failure: true
|
2019-04-27 15:38:28 +00:00
|
|
|
|
2019-07-06 18:03:29 +00:00
|
|
|
# For now, Clippy will just care about performance improvements as much of the
|
|
|
|
# codebase is not in a place that cleaning warnings will be benificial
|
2019-09-07 16:35:10 +00:00
|
|
|
|
2019-04-27 15:38:28 +00:00
|
|
|
clippy:
|
|
|
|
stage: post-build
|
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-04-27 15:38:28 +00:00
|
|
|
script:
|
2019-07-06 18:03:29 +00:00
|
|
|
- cargo clippy -- -W clippy::all
|
2019-04-27 15:38:28 +00:00
|
|
|
|
2019-05-03 19:06:14 +00:00
|
|
|
.commit: &commit
|
2019-09-07 16:35:10 +00:00
|
|
|
stage: post-build
|
2019-04-27 15:38:28 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-05-03 19:06:14 +00:00
|
|
|
except:
|
|
|
|
- schedules
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
|
|
|
|
commit:linux-debug:
|
|
|
|
<<: *commit
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
2019-07-08 16:17:50 +00:00
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build)
|
2019-04-18 22:23:11 +00:00
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build)
|
2019-04-27 15:38:28 +00:00
|
|
|
- rm -r -f commit-build
|
|
|
|
- mkdir commit-build
|
|
|
|
- cp target/debug/veloren-server-cli commit-build
|
|
|
|
- cp target/debug/veloren-voxygen commit-build
|
|
|
|
- cp -r assets commit-build/
|
2019-04-29 14:05:53 +00:00
|
|
|
- tar -cvjSf bin/commit-linux-debug.tar.bz2 commit-build
|
2019-04-29 20:21:51 +00:00
|
|
|
- cp bin/commit-linux-debug.tar.bz2 $CI_PROJECT_DIR
|
2019-04-18 22:23:11 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-04-29 19:36:41 +00:00
|
|
|
- commit-linux-debug.tar.bz2
|
2019-04-18 22:23:11 +00:00
|
|
|
expire_in: 1 week
|
|
|
|
|
2019-05-03 19:06:14 +00:00
|
|
|
commit:windows-debug:
|
|
|
|
<<: *commit
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
2019-07-08 16:17:50 +00:00
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu)
|
2019-04-18 22:23:11 +00:00
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu)
|
2019-04-27 15:38:28 +00:00
|
|
|
- rm -r -f commit-build
|
|
|
|
- mkdir commit-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe commit-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe commit-build
|
|
|
|
- cp -r assets commit-build/
|
2019-04-29 14:05:53 +00:00
|
|
|
- zip -r bin/commit-windows-debug.zip commit-build
|
2019-04-29 20:21:51 +00:00
|
|
|
- cp bin/commit-windows-debug.zip $CI_PROJECT_DIR
|
2019-04-18 22:23:11 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-04-29 19:36:41 +00:00
|
|
|
- commit-windows-debug.zip
|
2019-04-18 22:23:11 +00:00
|
|
|
expire_in: 1 week
|
2019-04-27 15:38:28 +00:00
|
|
|
|
|
|
|
#############
|
|
|
|
# NIGHTLY
|
|
|
|
#############
|
2019-04-18 22:23:11 +00:00
|
|
|
|
2019-05-07 05:12:46 +00:00
|
|
|
.nightly: &nightly
|
2019-09-07 16:35:10 +00:00
|
|
|
stage: post-build
|
2019-04-27 15:38:28 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci
|
|
|
|
tags:
|
2019-04-29 14:05:53 +00:00
|
|
|
- veloren-docker
|
2019-05-07 05:12:46 +00:00
|
|
|
only:
|
|
|
|
- schedules
|
|
|
|
|
|
|
|
nightly:linux-optimized:
|
|
|
|
<<: *nightly
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
2019-07-08 16:17:50 +00:00
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build --release)
|
2019-07-07 12:35:39 +00:00
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build --release)
|
2019-04-27 15:38:28 +00:00
|
|
|
- rm -r -f nightly-build
|
|
|
|
- mkdir nightly-build
|
|
|
|
- cp target/release/veloren-server-cli nightly-build
|
|
|
|
- cp target/release/veloren-voxygen nightly-build
|
|
|
|
- cp -r assets nightly-build/
|
2019-04-29 14:05:53 +00:00
|
|
|
- tar -cvjSf bin/nightly-linux-optimized.tar.bz2 nightly-build
|
2019-04-29 20:21:51 +00:00
|
|
|
- cp bin/nightly-linux-optimized.tar.bz2 $CI_PROJECT_DIR
|
2019-04-18 22:23:11 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-04-29 19:36:41 +00:00
|
|
|
- nightly-linux-optimized.tar.bz2
|
2019-04-18 22:23:11 +00:00
|
|
|
expire_in: 2 days
|
|
|
|
|
2019-05-07 05:12:46 +00:00
|
|
|
nightly:windows-optimized:
|
|
|
|
<<: *nightly
|
2019-04-18 22:23:11 +00:00
|
|
|
script:
|
2019-07-08 16:17:50 +00:00
|
|
|
- (cd voxygen && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu)
|
2019-07-07 12:35:39 +00:00
|
|
|
- (cd server-cli && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu)
|
2019-04-27 15:38:28 +00:00
|
|
|
- rm -r -f nightly-build
|
|
|
|
- mkdir nightly-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe nightly-build
|
|
|
|
- cp target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe nightly-build
|
|
|
|
- cp -r assets nightly-build/
|
2019-04-29 14:05:53 +00:00
|
|
|
- zip -r bin/nightly-windows-optimized.zip nightly-build
|
2019-04-29 20:21:51 +00:00
|
|
|
- cp bin/nightly-windows-optimized.zip $CI_PROJECT_DIR
|
2019-04-18 22:23:11 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-04-29 19:36:41 +00:00
|
|
|
- nightly-windows-optimized.zip
|
2019-04-18 22:23:11 +00:00
|
|
|
expire_in: 2 days
|