From 1db0e2a15c6e9b68a54987b5173c19204faf9716 Mon Sep 17 00:00:00 2001 From: Imbris Date: Thu, 20 May 2021 00:21:53 -0400 Subject: [PATCH] Use new multi image cache scheme in the CI and consolidate runner tag specification so that it is easier to modify --- .gitlab-ci.yml | 4 +++- .gitlab/CI/build.gitlab-ci.yml | 20 +++++++++++++------- .gitlab/CI/check.gitlab-ci.yml | 6 ++++-- .gitlab/CI/publish.gitlab-ci.yml | 6 +----- .gitlab/CI/recompile.yml | 6 ------ .gitlab/CI/release.yml | 8 +------- 6 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7a9ae3362..c1a864a411 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/.gitlab/CI/build.gitlab-ci.yml b/.gitlab/CI/build.gitlab-ci.yml index cc6fcbd679..a5f9bc243d 100644 --- a/.gitlab/CI/build.gitlab-ci.yml +++ b/.gitlab/CI/build.gitlab-ci.yml @@ -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: diff --git a/.gitlab/CI/check.gitlab-ci.yml b/.gitlab/CI/check.gitlab-ci.yml index 171f72dbc5..8fd11cb526 100644 --- a/.gitlab/CI/check.gitlab-ci.yml +++ b/.gitlab/CI/check.gitlab-ci.yml @@ -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 diff --git a/.gitlab/CI/publish.gitlab-ci.yml b/.gitlab/CI/publish.gitlab-ci.yml index 407722f225..3a471ec2a8 100644 --- a/.gitlab/CI/publish.gitlab-ci.yml +++ b/.gitlab/CI/publish.gitlab-ci.yml @@ -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 \ No newline at end of file + - mv target/doc/* public diff --git a/.gitlab/CI/recompile.yml b/.gitlab/CI/recompile.yml index 2f2bdecb82..07a7682a97 100644 --- a/.gitlab/CI/recompile.yml +++ b/.gitlab/CI/recompile.yml @@ -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: diff --git a/.gitlab/CI/release.yml b/.gitlab/CI/release.yml index b87f56c9d8..c692b1f148 100644 --- a/.gitlab/CI/release.yml +++ b/.gitlab/CI/release.yml @@ -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 \ No newline at end of file + - when: never