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-09 22:42:39 +00:00
GIT_STRATEGY : fetch
GIT_DEPTH : 3
GIT_CLEAN_FLAGS : -f
2019-10-08 08:13:40 +00:00
stages :
- optional-builds
- check-compile
- post
2019-04-18 22:23:11 +00:00
before_script :
2019-10-08 08:13:40 +00:00
- source $HOME/.cargo/env
2019-11-19 19:26:27 +00:00
- df -h /
2019-10-08 08:13:40 +00:00
- free -h
- cargo --version
2019-10-08 17:03:00 +00:00
- export DISABLE_GIT_LFS_CHECK=true
2019-11-18 11:11:54 +00:00
- rm -r target || echo "target doesnt exist, which is fine"
- ln -s /dockercache/veloren/target target
2019-10-08 08:13:40 +00:00
# -- optional build
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
optional-release:linux :
<< : *optional-release
script :
2019-11-21 13:11:37 +00:00
- VELOREN_ASSETS=assets cargo build --verbose --release
2019-10-08 17:03:00 +00:00
- cp target/release/veloren-server-cli $CI_PROJECT_DIR
- cp target/release/veloren-voxygen $CI_PROJECT_DIR
2019-11-03 22:27:37 +00:00
- strip --strip-all veloren-server-cli
- strip --strip-all veloren-voxygen
2019-12-01 21:16:55 +00:00
# Compress ogg and WAV
- find assets/ -type f -name "*.ogg" | xargs -i@ ffmpeg -i @ -c:a libopus -b:a 32000 -compression_level 0 -application audio @.audiocompress.ogg
- find assets/ -type f -name "*.wav" | xargs -i@ ffmpeg -i @ -ab 32000 -vbr on -compression_level 0 -application audio @.audiocompress.wav
# Overwrite old files
- find assets/ -type f -name "*.audiocompress.*" | xargs -i@ sh -c 'name=@ && mv -f @ ${name%.*.*}'
2019-10-08 17:03:00 +00:00
artifacts :
paths :
- veloren-server-cli
- veloren-voxygen
- assets/
2019-10-17 13:06:20 +00:00
- LICENSE
2019-10-08 17:03:00 +00:00
expire_in : 1 week
2019-10-08 08:13:40 +00:00
optional-release:windows :
<< : *optional-release
script :
2019-11-21 13:11:37 +00:00
- VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu --release
2019-10-08 17:03:00 +00:00
- cp target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe $CI_PROJECT_DIR
- cp target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe $CI_PROJECT_DIR
artifacts :
paths :
- veloren-server-cli.exe
- veloren-voxygen.exe
- assets/
2019-10-17 13:06:20 +00:00
- LICENSE
2019-10-08 17:03:00 +00:00
expire_in : 1 week
2019-10-08 08:13:40 +00:00
# --
# -- check
check :
stage : check-compile
tags :
- veloren-docker
script :
2019-11-19 15:48:12 +00:00
- RUSTFLAGS="-D warnings" cargo check
2019-10-08 08:13:40 +00:00
code-quality :
stage : check-compile
tags :
- veloren-docker
script :
- cargo clippy -- --warn clippy::all
- cargo fmt --all -- --check
2019-10-28 18:18:02 +00:00
security :
stage : check-compile
2019-10-28 18:23:27 +00:00
allow_failure : true
2019-10-28 18:18:02 +00:00
tags :
- veloren-docker
script :
2019-10-28 18:23:27 +00:00
- cargo audit
2019-10-28 18:18:02 +00:00
2019-10-08 08:13:40 +00:00
# --
# -- 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
when : delayed
start_in : 5 seconds
tags :
- veloren-docker
script :
2019-11-18 11:11:54 +00:00
- echo "Workaround, cargo tests fails due some rust files are already deleted, so we just stack cargo test. if its the os error, it wont appear on them all, if its a real error, it will retry and then fail"
- cargo test || cargo test || cargo test || cargo test
2019-10-08 08:13:40 +00:00
2019-11-19 21:31:51 +00:00
coverage :
stage : post
when : delayed
start_in : 5 seconds
tags :
- veloren-docker
script :
2019-11-21 14:25:08 +00:00
- sed -i '/cargo-features/d' Cargo.toml
- sed -i '/profile.dev.overrides/,+1d' Cargo.toml
2019-11-19 21:31:51 +00:00
- cargo tarpaulin -v
allow_failure : true
2019-10-08 08:13:40 +00:00
benchmarks :
stage : post
when : delayed
start_in : 5 seconds
tags :
- veloren-docker
script :
- cargo bench
allow_failure : true
linux :
stage : post
when : delayed
start_in : 5 seconds
only :
refs :
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+\.[0-9]+/
- /^master$/
tags :
- veloren-docker
script :
2019-11-21 13:11:37 +00:00
- VELOREN_ASSETS=assets cargo build --release
2019-10-08 17:03:00 +00:00
- cp -r target/release/veloren-server-cli $CI_PROJECT_DIR
- cp -r target/release/veloren-voxygen $CI_PROJECT_DIR
2019-11-03 22:27:37 +00:00
- strip --strip-all veloren-server-cli
- strip --strip-all veloren-voxygen
2019-12-01 21:16:55 +00:00
# Compress ogg and WAV
- find assets/ -type f -name "*.ogg" | xargs -i@ ffmpeg -i @ -c:a libopus -b:a 32000 -compression_level 0 -application audio @.audiocompress.ogg
- find assets/ -type f -name "*.wav" | xargs -i@ ffmpeg -i @ -ab 32000 -vbr on -compression_level 0 -application audio @.audiocompress.wav
# Overwrite old files
- find assets/ -type f -name "*.audiocompress.*" | xargs -i@ sh -c 'name=@ && mv -f @ ${name%.*.*}'
2019-10-08 17:03:00 +00:00
artifacts :
paths :
- veloren-server-cli
- veloren-voxygen
- assets/
2019-10-29 22:48:15 +00:00
- LICENSE
2019-10-08 17:03:00 +00:00
expire_in : 1 week
2019-10-08 08:13:40 +00:00
windows :
stage : post
when : delayed
start_in : 5 seconds
only :
refs :
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+\.[0-9]+/
- /^master$/
tags :
- veloren-docker
script :
2019-11-21 13:11:37 +00:00
- VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu --release
2019-10-08 17:03:00 +00:00
- cp -r target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe $CI_PROJECT_DIR
- cp -r target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe $CI_PROJECT_DIR
2019-12-01 21:16:55 +00:00
# Compress ogg and WAV
- find assets/ -type f -name "*.ogg" | xargs -i@ ffmpeg -i @ -c:a libopus -b:a 32000 -compression_level 0 -application audio @.audiocompress.ogg
- find assets/ -type f -name "*.wav" | xargs -i@ ffmpeg -i @ -ab 32000 -vbr on -compression_level 0 -application audio @.audiocompress.wav
# Overwrite old files
- find assets/ -type f -name "*.audiocompress.*" | xargs -i@ sh -c 'name=@ && mv -f @ ${name%.*.*}'
2019-10-08 17:03:00 +00:00
artifacts :
paths :
- veloren-server-cli.exe
- veloren-voxygen.exe
- assets/
2019-10-29 22:48:15 +00:00
- LICENSE
2019-10-08 17:03:00 +00:00
expire_in : 1 week
2019-10-08 08:13:40 +00:00
2019-12-01 21:16:55 +00:00
# --