2019-10-08 09:14:46 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci:latest
|
2019-04-18 22:23:11 +00:00
|
|
|
|
|
|
|
variables:
|
2019-10-08 08:13:40 +00:00
|
|
|
GIT_STRATEGY: none
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- optional-builds
|
|
|
|
- check-compile
|
|
|
|
- post
|
|
|
|
|
2019-04-18 22:23:11 +00:00
|
|
|
before_script:
|
2019-10-08 08:13:40 +00:00
|
|
|
- mkdir -p veloren
|
|
|
|
- cd veloren
|
|
|
|
- git lfs install
|
|
|
|
- if [ ! -d ".git" ]; then git clone https://gitlab.com/veloren/veloren.git .; fi
|
|
|
|
- git clean -f
|
|
|
|
- git lfs fetch
|
|
|
|
- git lfs checkout $CI_COMMIT_SHA
|
|
|
|
- source $HOME/.cargo/env
|
|
|
|
- df -h
|
|
|
|
- free -h
|
|
|
|
- gcc -v
|
|
|
|
- cargo --version
|
|
|
|
|
|
|
|
# -- optional build
|
|
|
|
|
|
|
|
.optional-debug: &optional-debug
|
|
|
|
stage: optional-builds
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
except:
|
|
|
|
- schedules
|
|
|
|
when: manual
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 12:39:52 +00:00
|
|
|
- veloren/artifact/*
|
2019-10-08 08:13:40 +00:00
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
optional-debug:linux:
|
|
|
|
<<: *optional-debug
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-debug"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
script:
|
|
|
|
- mkdir artifact
|
|
|
|
- cd voxygen && VELOREN_ASSETS=assets cargo build --verbose && cd ..
|
|
|
|
- cd server-cli && VELOREN_ASSETS=assets cargo build --verbose && cd ..
|
|
|
|
- cp target/debug/veloren-server-cli ./artifact
|
|
|
|
- cp target/debug/veloren-voxygen ./artifact
|
|
|
|
- cp -r assets ./artifact
|
|
|
|
|
|
|
|
optional-debug:windows:
|
|
|
|
<<: *optional-debug
|
|
|
|
cache:
|
|
|
|
key: "cache-windows-debug"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
script:
|
|
|
|
- mkdir artifact
|
|
|
|
- cd voxygen && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu && cd ..
|
|
|
|
- cd server-cli && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu && cd ..
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe ./artifact
|
|
|
|
- cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe ./artifact
|
|
|
|
- cp -r assets ./artifact
|
2019-09-07 16:35:10 +00:00
|
|
|
|
|
|
|
.optional-release: &optional-release
|
2019-10-08 08:13:40 +00:00
|
|
|
stage: optional-builds
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
except:
|
|
|
|
- schedules
|
|
|
|
when: manual
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 12:39:52 +00:00
|
|
|
- veloren/artifact/*
|
2019-10-08 08:13:40 +00:00
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
optional-release:linux:
|
|
|
|
<<: *optional-release
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-release"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
script:
|
|
|
|
- mkdir artifact
|
|
|
|
- cd voxygen && VELOREN_ASSETS=assets cargo build --verbose --release && cd ..
|
|
|
|
- cd server-cli && VELOREN_ASSETS=assets cargo build --verbose --release && cd ..
|
|
|
|
- cp target/release/veloren-server-cli ./artifact
|
|
|
|
- cp target/release/veloren-voxygen ./artifact
|
|
|
|
- cp -r assets ./artifact
|
|
|
|
|
|
|
|
optional-release:windows:
|
|
|
|
<<: *optional-release
|
|
|
|
cache:
|
|
|
|
key: "cache-windows-release"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
script:
|
|
|
|
- mkdir artifact
|
|
|
|
- cd voxygen && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu --release && cd ..
|
|
|
|
- cd server-cli && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu --release && cd ..
|
|
|
|
- cp target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe ./artifact
|
|
|
|
- cp target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe ./artifact
|
|
|
|
- cp -r assets ./artifact
|
|
|
|
|
|
|
|
# --
|
|
|
|
|
|
|
|
# -- check
|
|
|
|
|
|
|
|
check:
|
|
|
|
stage: check-compile
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-debug"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
script:
|
|
|
|
- RUSTFLAGS="-D warnings" cargo check --verbose
|
|
|
|
|
|
|
|
code-quality:
|
|
|
|
stage: check-compile
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-debug"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
script:
|
|
|
|
- cargo clippy -- --warn clippy::all
|
|
|
|
- cargo fmt --all -- --check
|
|
|
|
|
|
|
|
# --
|
|
|
|
|
|
|
|
# -- post build
|
2019-04-27 15:38:28 +00:00
|
|
|
|
2019-04-18 22:23:11 +00:00
|
|
|
unittests:
|
2019-10-08 08:13:40 +00:00
|
|
|
stage: post
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-debug"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
when: delayed
|
|
|
|
start_in: 5 seconds
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
script:
|
|
|
|
- cargo test
|
|
|
|
|
|
|
|
benchmarks:
|
|
|
|
stage: post
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-release"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
when: delayed
|
|
|
|
start_in: 5 seconds
|
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
script:
|
|
|
|
- cargo bench
|
|
|
|
allow_failure: true
|
|
|
|
|
|
|
|
linux:
|
|
|
|
stage: post
|
|
|
|
cache:
|
|
|
|
key: "cache-linux-release"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
when: delayed
|
|
|
|
start_in: 5 seconds
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- /^r[0-9]+\.[0-9]+\.[0-9]+/
|
|
|
|
- /^v[0-9]+\.[0-9]+\.[0-9]+/
|
|
|
|
- /^master$/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 12:39:52 +00:00
|
|
|
- veloren/artifact/*
|
2019-10-08 08:13:40 +00:00
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
script:
|
|
|
|
- mkdir artifact
|
|
|
|
- cd voxygen && VELOREN_ASSETS=assets cargo build --release && cd ..
|
|
|
|
- cd server-cli && VELOREN_ASSETS=assets cargo build --release && cd ..
|
|
|
|
- cp -r target/release/veloren-server-cli ./artifact
|
|
|
|
- cp -r target/release/veloren-voxygen ./artifact
|
|
|
|
- cp -r assets ./artifact
|
|
|
|
|
|
|
|
windows:
|
|
|
|
stage: post
|
|
|
|
cache:
|
|
|
|
key: "cache-windows-release"
|
|
|
|
paths:
|
|
|
|
- veloren/
|
|
|
|
when: delayed
|
|
|
|
start_in: 5 seconds
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- /^r[0-9]+\.[0-9]+\.[0-9]+/
|
|
|
|
- /^v[0-9]+\.[0-9]+\.[0-9]+/
|
|
|
|
- /^master$/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 12:39:52 +00:00
|
|
|
- veloren/artifact/*
|
2019-10-08 08:13:40 +00:00
|
|
|
tags:
|
|
|
|
- veloren-docker
|
|
|
|
script:
|
|
|
|
- mkdir artifact
|
|
|
|
- cd voxygen && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu --release && cd ..
|
|
|
|
- cd server-cli && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu --release && cd ..
|
2019-10-08 10:46:40 +00:00
|
|
|
- cp -r target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe ./artifact
|
|
|
|
- cp -r target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe ./artifact
|
2019-10-08 08:13:40 +00:00
|
|
|
- cp -r assets ./artifact
|
|
|
|
|
|
|
|
# --
|