Use new multi image cache scheme in the CI and consolidate runner tag specification so that it is easier to modify

This commit is contained in:
Imbris 2021-05-20 00:21:53 -04:00
parent 23eca4c3f6
commit 1db0e2a15c
6 changed files with 22 additions and 28 deletions

View File

@ -13,9 +13,9 @@ variables:
# ttps://docs.gitlab.com/ee/ci/yaml/#shallow-cloning
GIT_DEPTH: 3
GIT_CLEAN_FLAGS: -f
CACHE_IMAGE_TAG: 7ea40612
default:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache:e134e812
# https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-pending-pipelines
interruptible: true
# Retry automatically incase the runner times out or there's a runner failure
@ -24,6 +24,8 @@ default:
when:
- runner_system_failure
- stuck_or_timeout_failure
tags:
- veloren-wgpu-docker
before_script:
- source $HOME/.cargo/env

View File

@ -1,10 +1,11 @@
unittests:
extends: .recompile-branch
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
variables:
GIT_DEPTH: 9999999999999
script:
- ln -s /dockercache/cache-all target
- ln -s /dockercache/target target
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- cargo test --package veloren-i18n --lib test_all_localizations -- --nocapture --ignored
- rm -r target/debug/incremental* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
@ -15,11 +16,12 @@ unittests:
benchmarks:
extends: .post-merge
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/bench:${CACHE_IMAGE_TAG}
tags:
- veloren-benchmark
script:
- unset DISABLE_GIT_LFS_CHECK
- ln -s /dockercache/cache-all target
- ln -s /dockercache/target target
- ls -la target/*
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- rm -r target/release/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
@ -40,8 +42,9 @@ benchmarks:
coverage:
extends: .post-merge
stage: build
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/tarpaulin:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/cache-tarpaulin target
- ln -s /dockercache/target target
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- find ./* -name "Cargo.toml" -exec sed -i 's/, "simd"]/]/g' {} \;
- find ./* -name "Cargo.toml" -exec sed -i 's/"simd"]/]/g' {} \;
@ -52,8 +55,9 @@ coverage:
#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/cache-release-linux target
- ln -s /dockercache/target target
- rm -r target/release/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- VELOREN_USERDATA_STRATEGY=executable cargo build --release
- cp -r target/release/veloren-server-cli $CI_PROJECT_DIR
@ -67,8 +71,9 @@ coverage:
expire_in: 1 week
.twindows:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/release-windows:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/cache-release-windows target
- ln -s /dockercache/target target
- rm -r target/release/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- VELOREN_USERDATA_STRATEGY=executable cargo build --target=x86_64-pc-windows-gnu --release
- cp -r target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe $CI_PROJECT_DIR
@ -82,10 +87,11 @@ coverage:
expire_in: 1 week
.tmacos:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/release-macos:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/cache-release-macos target
- ln -s /dockercache/target target
- rm -r target/release/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- VELOREN_USERDATA_STRATEGY=executable WINIT_LINK_COLORSYNC=true PATH="/dockercache/osxcross/target/bin:$PATH" COREAUDIO_SDK_PATH=/dockercache/osxcross/target/SDK/MacOSX10.13.sdk CC=o64-clang CXX=o64-clang++ cargo build --target x86_64-apple-darwin --release
- VELOREN_USERDATA_STRATEGY=executable WINIT_LINK_COLORSYNC=true PATH="/osxcross/target/bin:$PATH" COREAUDIO_SDK_PATH=/osxcross/target/SDK/MacOSX10.13.sdk CC=o64-clang CXX=o64-clang++ cargo build --target x86_64-apple-darwin --release
- cp -r target/x86_64-apple-darwin/release/veloren-server-cli $CI_PROJECT_DIR
- cp -r target/x86_64-apple-darwin/release/veloren-voxygen $CI_PROJECT_DIR
artifacts:

View File

@ -2,8 +2,9 @@
code-quality:
extends: .recompile-branch
stage: check
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
script:
- ln -s /dockercache/cache-all target
- ln -s /dockercache/target target
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- cargo clippy --all-targets --locked -- -D warnings
- cargo fmt --all -- --check
@ -11,7 +12,8 @@ code-quality:
security:
extends: .recompile-branch
stage: check
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
allow_failure: true
script:
- ln -s /dockercache/cache-all target
- ln -s /dockercache/target target
- cargo audit

View File

@ -2,8 +2,6 @@
# https://gitlab.com/veloren/veloren/container_registry
.publish:
stage: publish
tags:
- veloren-docker
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"
when: always
@ -11,8 +9,6 @@
.publish-nightly:
stage: publish
tags:
- veloren-docker
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
@ -53,4 +49,4 @@ pages:
- rm -rf public
- mkdir -p public
- cargo doc --no-deps --document-private-items
- mv target/doc/* public
- mv target/doc/* public

View File

@ -1,7 +1,5 @@
# Template to only run if actual changes has been made to the code and not just documentation
.recompile-branch:
tags:
- veloren-docker
rules:
- if: $CI_COMMIT_REF_NAME !~ /^master$/
# No '-' here is *very* important: https://docs.gitlab.com/ee/ci/yaml/#complex-rule-clauses
@ -14,8 +12,6 @@
# like .recompile-branch but will run on master too
.recompile:
tags:
- veloren-docker
rules:
- changes:
- "**/*.{glsl,rs,ron,toml,vox,png,wav}"
@ -27,8 +23,6 @@
# Template to only run these after a branch has merged to master
.post-merge:
stage: build
tags:
- veloren-docker
rules:
- if: $CI_COMMIT_REF_NAME =~ /^master$/
changes:

View File

@ -1,8 +1,6 @@
# allow_failure: true makes these pipelines manual and "non-blocking" which changed with except -> rule syntax
.optional-release:
stage: check
tags:
- veloren-docker
rules:
- if: $CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ || $CI_PIPELINE_SOURCE == "schedule"
when: never
@ -12,8 +10,6 @@
# Template to only run if pushes to master or a tag happened
.release:
stage: build
tags:
- veloren-docker
rules:
- if: $CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/
when: always
@ -22,9 +18,7 @@
# Template to only run if pushes to master or a tag happened
.release-nightly-tmp-fix-airshipper:
stage: build-nightly
tags:
- veloren-docker
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
when: always
- when: never
- when: never