veloren/.gitlab/CI/build.gitlab-ci.yml

233 lines
7.7 KiB
YAML
Raw Normal View History

unittests:
extends: .recompile-branch
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
tags: ["veloren/veloren", "check"]
variables:
GIT_DEPTH: 9999999999999
script:
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/unittest.sh
- source ./.gitlab/scripts/unittest.sh
retry:
max: 2
translation:
extends: .release
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
tags: ["veloren/veloren", "check"]
script:
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/translation.sh
- source ./.gitlab/scripts/translation.sh
- TAGUUID="Z$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)" || echo "ignore this returncode, dont ask me why, it works"
- echo $TAGUUID # Use TAGUUID to mitigate https://xkcd.com/327/ in the branch name
- echo 'SET veloren.timestamp = "'"$(git show --no-patch --no-notes --pretty='%cd' HEAD)"'";' > upload.sql
- echo "SET veloren.branch = \$${TAGUUID}\$${CI_COMMIT_REF_NAME}\$${TAGUUID}\$;" >> upload.sql
- echo "SET veloren.sha = \$${TAGUUID}\$${CI_COMMIT_SHA}\$${TAGUUID}\$;" >> upload.sql
- echo '\copy translations ("country_code", "file_name", "translation_key", "status", "git_commit") from '"'translation_analysis.csv' csv header" >> upload.sql
- cat upload.sql
- PGPASSWORD="${CIDBPASSWORD}" PGSSLROOTCERT="./.gitlab/ci-db.crt" psql "sslmode=verify-ca host=grafana.veloren.net port=15432 dbname=translations" -U hgseehzjtsrghtjdcqw -f upload.sql;
retry:
max: 2
benchmarks:
extends: .release
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/bench:${CACHE_IMAGE_TAG}
tags: ["veloren/veloren", "check", "benchmark"]
script:
- unset DISABLE_GIT_LFS_CHECK
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/benchmark.sh
- source ./.gitlab/scripts/benchmark.sh
- TAGUUID="Z$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)" || echo "ignore this returncode, dont ask me why, it works"
- echo $TAGUUID # Use TAGUUID to mitigate https://xkcd.com/327/ in the branch name
- echo 'SET veloren.timestamp = "'"$(git show --no-patch --no-notes --pretty='%cd' HEAD)"'";' > upload.sql
- echo "SET veloren.branch = \$${TAGUUID}\$${CI_COMMIT_REF_NAME}\$${TAGUUID}\$;" >> upload.sql
- echo "SET veloren.sha = \$${TAGUUID}\$${CI_COMMIT_SHA}\$${TAGUUID}\$;" >> upload.sql
2021-04-18 18:01:26 +00:00
- find target/criterion -wholename "*new/*.csv" -exec echo '\copy benchmarks ("group", "function", "value", throughput_num, throughput_type, sample_measured_value, unit, iteration_count) from '"'{}' csv header" >> upload.sql \;
- cat upload.sql
2021-06-03 15:26:09 +00:00
- PGPASSWORD="${CIDBPASSWORD}" PGSSLROOTCERT="./.gitlab/ci-db.crt" psql "sslmode=verify-ca host=grafana.veloren.net port=15432 dbname=benchmarks" -U hgseehzjtsrghtjdcqw -f upload.sql;
retry:
max: 2
# Coverage is needed on master for the README.md badge to work
2020-10-26 18:52:45 +00:00
# tmp remove simd as it doesnt work with tarpaulin: https://github.com/rust-lang/rust/issues/77529
coverage:
extends: .release
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/tarpaulin:${CACHE_IMAGE_TAG}
tags: ["veloren/veloren", "check"]
script:
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/coverage.sh
- source ./.gitlab/scripts/coverage.sh
retry:
max: 2
#linux, windows, macos builds here as template
.tlinux:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/release-linux:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/linux.sh
- source ./.gitlab/scripts/linux.sh
- cp -r target/release/veloren-server-cli $CI_PROJECT_DIR
- cp -r target/release/veloren-voxygen $CI_PROJECT_DIR
artifacts:
paths:
- veloren-server-cli
- veloren-voxygen
- assets/
- LICENSE
expire_in: 1 week
2021-11-16 05:41:33 +00:00
.tlinux-aarch64:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/release-linux-aarch64:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/linux-aarch64.sh
- source ./.gitlab/scripts/linux-aarch64.sh
- cp -r target/aarch64-unknown-linux-gnu/release/veloren-server-cli $CI_PROJECT_DIR
- cp -r target/aarch64-unknown-linux-gnu/release/veloren-voxygen $CI_PROJECT_DIR
2021-11-16 05:41:33 +00:00
artifacts:
paths:
- veloren-server-cli
- veloren-voxygen
- assets/
- LICENSE
expire_in: 1 week
.twindows:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/release-windows:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/target target
- cat ./.gitlab/scripts/windows.sh
- source ./.gitlab/scripts/windows.sh
- 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
- cp /usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/libgcc_s_seh-1.dll $CI_PROJECT_DIR
- cp /usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/libstdc++-6.dll $CI_PROJECT_DIR
- cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll $CI_PROJECT_DIR
artifacts:
paths:
- veloren-server-cli.exe
- veloren-voxygen.exe
- assets/
- LICENSE
- libgcc_s_seh-1.dll
- libstdc++-6.dll
- libwinpthread-1.dll
expire_in: 1 week
.tmacos:
2021-06-01 19:33:41 +00:00
tags: ["veloren-macos"]
before_script:
- source $HOME/.cargo/env
- cargo --version
- export DISABLE_GIT_LFS_CHECK=true
- export VELOREN_ASSETS="$(pwd)/assets"
- echo "VELOREN_ASSETS=$VELOREN_ASSETS"
- export RUSTFLAGS="-D warnings"
script:
2021-06-01 19:33:41 +00:00
- export MACOSX_DEPLOYMENT_TARGET="10.13"
- export VELOREN_USERDATA_STRATEGY=executable
only build once, dont build multiple targets. save time Profiles: (all are build, all are release, all are --no-default-features --features="default-publish" ) A) -p veloren-voxygen AND -p veloren-server-cli B) NONE AND -p veloren-server-cli C) NONE D) NONE but server-cli/Cargo.toml has a default-publish feature Timings A) > time cargo build -p veloren-voxygen --release --no-default-features --features default-publish Compiling veloren-client v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/client) Compiling refinery v0.5.0 (https://gitlab.com/veloren/refinery.git?rev=8ecf4b4772d791e6c8c0a3f9b66a7530fad1af3e#8ecf4b47) Compiling gfx-auxil v0.9.0 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling gfx-backend-gl v0.8.1 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling veloren-server v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server) Compiling wgpu v0.8.0 (https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549) Compiling wgpu-profiler v0.4.0 (https://github.com/Imberflur/wgpu-profiler?tag=wgpu-0.8#b156eb14) Finished release [optimized] target(s) in 16m 19s cargo build -p veloren-voxygen --release --no-default-features --features 3091.78s user 71.80s system 322% cpu 16:19.44 total > time cargo build --release -p veloren-server-cli Compiling veloren-world v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/world) Compiling refinery v0.5.0 (https://gitlab.com/veloren/refinery.git?rev=8ecf4b4772d791e6c8c0a3f9b66a7530fad1af3e#8ecf4b47) Compiling veloren-server v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server) Compiling veloren-server-cli v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server-cli) Finished release [optimized] target(s) in 6m 06s cargo build --release -p veloren-server-cli 1024.29s user 18.42s system 284% cpu 6:06.62 total B) > time cargo build --release --no-default-features --features default-publish Compiling veloren-client v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/client) Compiling veloren-voxygen-egui v0.9.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/egui) Compiling gfx-auxil v0.9.0 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling gfx-backend-gl v0.8.1 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling refinery v0.5.0 (https://gitlab.com/veloren/refinery.git?rev=8ecf4b4772d791e6c8c0a3f9b66a7530fad1af3e#8ecf4b47) Compiling veloren-server v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server) Compiling wgpu v0.8.0 (https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549) Compiling wgpu-profiler v0.4.0 (https://github.com/Imberflur/wgpu-profiler?tag=wgpu-0.8#b156eb14) Compiling veloren-voxygen-anim-dyn v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/anim/dyn) Compiling veloren-voxygen-egui-dyn v0.9.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/egui/dyn) Compiling veloren-server-cli v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server-cli) Finished release [optimized] target(s) in 17m 10s cargo build --release --no-default-features --features default-publish 4415.58s user 91.10s system 437% cpu 17:10.66 total > time cargo build --release -p veloren-server-cli Compiling veloren-world v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/world) Compiling refinery v0.5.0 (https://gitlab.com/veloren/refinery.git?rev=8ecf4b4772d791e6c8c0a3f9b66a7530fad1af3e#8ecf4b47) Compiling veloren-server v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server) Compiling veloren-server-cli v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server-cli) Finished release [optimized] target(s) in 6m 08s cargo build --release -p veloren-server-cli 1123.93s user 23.01s system 311% cpu 6:08.14 total C) > time cargo build --release --no-default-features --features default-publish Compiling prometheus-hyper v0.1.2 Compiling authc v1.0.0 (https://gitlab.com/veloren/auth.git?rev=fb3dcbc4962b367253f8f2f92760ef44d2679c9a#fb3dcbc4) Compiling veloren-common-net v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/common/net) Compiling veloren-plugin-api v0.1.0 (/mnt/nfs/marcel/Entw/Rust/veloren/plugin/api) Compiling veloren-voxygen-anim v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/anim) Compiling veloren-plugin-rt v0.1.0 (/mnt/nfs/marcel/Entw/Rust/veloren/plugin/rt) Compiling veloren-common-systems v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/common/systems) Compiling veloren-common-state v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/common/state) Compiling veloren-world v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/world) Compiling veloren-world v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/world) Compiling veloren-client v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/client) Compiling veloren-voxygen-egui v0.9.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/egui) Compiling refinery v0.5.0 (https://gitlab.com/veloren/refinery.git?rev=8ecf4b4772d791e6c8c0a3f9b66a7530fad1af3e#8ecf4b47) Compiling veloren-server v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server) Compiling gfx-auxil v0.9.0 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling gfx-backend-gl v0.8.1 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling wgpu v0.8.0 (https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549) Compiling wgpu-profiler v0.4.0 (https://github.com/Imberflur/wgpu-profiler?tag=wgpu-0.8#b156eb14) Compiling veloren-voxygen-anim-dyn v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/anim/dyn) Compiling veloren-voxygen-egui-dyn v0.9.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/egui/dyn) Compiling veloren-server-cli v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server-cli) Finished release [optimized] target(s) in 16m 41s cargo build --release --no-default-features --features default-publish 4349.71s user 90.02s system 443% cpu 16:41.58 total D) > time cargo build --release --no-default-features --features default-publish Compiling prometheus-hyper v0.1.2 Compiling authc v1.0.0 (https://gitlab.com/veloren/auth.git?rev=fb3dcbc4962b367253f8f2f92760ef44d2679c9a#fb3dcbc4) Compiling veloren-common-net v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/common/net) Compiling veloren-plugin-api v0.1.0 (/mnt/nfs/marcel/Entw/Rust/veloren/plugin/api) Compiling veloren-voxygen-anim v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/anim) Compiling veloren-plugin-rt v0.1.0 (/mnt/nfs/marcel/Entw/Rust/veloren/plugin/rt) Compiling veloren-common-state v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/common/state) Compiling veloren-common-systems v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/common/systems) Compiling veloren-world v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/world) Compiling veloren-client v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/client) Compiling veloren-voxygen-egui v0.9.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/egui) Compiling refinery v0.5.0 (https://gitlab.com/veloren/refinery.git?rev=8ecf4b4772d791e6c8c0a3f9b66a7530fad1af3e#8ecf4b47) Compiling veloren-server v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server) Compiling gfx-auxil v0.9.0 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling gfx-backend-gl v0.8.1 (https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3) Compiling wgpu v0.8.0 (https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549) Compiling wgpu-profiler v0.4.0 (https://github.com/Imberflur/wgpu-profiler?tag=wgpu-0.8#b156eb14) Compiling veloren-voxygen-egui-dyn v0.9.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/egui/dyn) Compiling veloren-voxygen-anim-dyn v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/voxygen/anim/dyn) Compiling veloren-server-cli v0.10.0 (/mnt/nfs/marcel/Entw/Rust/veloren/server-cli) Finished release [optimized] target(s) in 17m 30s cargo build --release --no-default-features --features default-publish 4462.34s user 92.17s system 433% cpu 17:31.00 total Hashes A) veloren-voxygen: e9de69144b4d459dc0da2775b2b87ac9 veloren-server-cli: 8c131c1b1daaa6efd0f83d95d9b5dad9 B) veloren-voxygen: 415e14ec1c14a6a559d2908b843d88d5 veloren-server-cli: 8c131c1b1daaa6efd0f83d95d9b5dad9 C) veloren-voxygen: 415e14ec1c14a6a559d2908b843d88d5 veloren-server-cli: 3bf56d0d0a76191a578ed5e71389f512 D) veloren-voxygen: 415e14ec1c14a6a559d2908b843d88d5 veloren-server-cli: c9dc4fb0bfcbd831150eebac788e2f71 Binary Sizes: A) veloren-voxygen: 156667288 veloren-server-cli: 85136736 B) veloren-voxygen: 162860552 veloren-server-cli: 85136736 C) veloren-voxygen: 162860552 veloren-server-cli: 95597304 D) veloren-voxygen: 162860552 veloren-server-cli: 95586360 Total Cache Size: A) 4.1G B) 5G C) 4.1G D) 4.1G
2021-07-15 08:56:32 +00:00
- cargo build --release --no-default-features --features default-publish
2021-06-01 19:33:41 +00:00
- cp -r target/release/veloren-server-cli $CI_PROJECT_DIR
- cp -r target/release/veloren-voxygen $CI_PROJECT_DIR
artifacts:
paths:
- veloren-server-cli
- veloren-voxygen
- assets/
- LICENSE
expire_in: 1 week
2021-06-01 19:33:41 +00:00
# e.g. post merge and scheduled builds
.tmacos-master-cache:
cache:
key: "macos-master-cache"
paths:
- target/
# e.g. optional builds from MRs
.tmacos-mr-cache:
cache:
key: "macos-mr-cache"
paths:
- target/
# build on release or master
linux:
extends:
- .tlinux
- .release
tags: ["veloren/veloren", "build", "publish", "trusted"]
windows:
extends:
- .twindows
- .release
tags: ["veloren/veloren", "build", "publish", "trusted"]
macos:
extends:
- .tmacos
- .release
2021-06-01 19:33:41 +00:00
- .tmacos-master-cache
tags: ["veloren/veloren:macos", "build", "publish", "trusted"]
# build on schedule quickfix till airshipper 0.5
air-linux:
extends:
- .tlinux
- .release-nightly-tmp-fix-airshipper
tags: ["veloren/veloren", "build", "publish", "trusted"]
2021-11-16 05:41:33 +00:00
air-linux-aarch64:
extends:
- .tlinux-aarch64
- .release-nightly-tmp-fix-airshipper
tags: ["veloren/veloren", "build", "publish", "trusted"]
air-windows:
extends:
- .twindows
- .release-nightly-tmp-fix-airshipper
tags: ["veloren/veloren", "build", "publish", "trusted"]
air-macos:
extends:
- .tmacos
- .release-nightly-tmp-fix-airshipper
2021-06-01 19:33:41 +00:00
- .tmacos-master-cache
tags: ["veloren/veloren:macos", "build", "publish", "trusted"]
# if NOT release or master, allow optional builds
opt-linux:
extends:
- .tlinux
- .optional-release
tags: ["veloren/veloren", "build"]
2021-11-16 05:41:33 +00:00
opt-linux-aarch64:
extends:
- .tlinux-aarch64
- .optional-release
tags: ["veloren/veloren", "build"]
opt-windows:
extends:
- .twindows
- .optional-release
tags: ["veloren/veloren", "build"]
opt-macos:
extends:
- .tmacos
2020-07-12 02:38:11 +00:00
- .optional-release
2021-06-01 19:33:41 +00:00
- .tmacos-mr-cache
tags: ["veloren/veloren:macos", "build"]