change(ci): document and add retries + fmt

This commit is contained in:
Songtronix 2020-05-14 18:12:22 +02:00
parent 07d7d17182
commit b6135f60ed
5 changed files with 192 additions and 191 deletions

View File

@ -5,7 +5,12 @@ stages:
- publish - publish
variables: variables:
# Note: this is deprecated!
# https://docs.gitlab.com/ee/ci/yaml/#git-strategy
# However in gitlab web ui it's set to fetch so it should be fine ¯\_(ツ)_/¯
GIT_STRATEGY: fetch GIT_STRATEGY: fetch
# Note: this is deprecated!
# ttps://docs.gitlab.com/ee/ci/yaml/#shallow-cloning
GIT_DEPTH: 3 GIT_DEPTH: 3
GIT_CLEAN_FLAGS: -f GIT_CLEAN_FLAGS: -f
@ -13,7 +18,12 @@ default:
image: registry.gitlab.com/veloren/veloren-docker-ci:latest image: registry.gitlab.com/veloren/veloren-docker-ci:latest
# https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-pending-pipelines # https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-pending-pipelines
interruptible: true interruptible: true
# Retry automatically incase the runner times out or there's a runner failure
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
before_script: before_script:
- source $HOME/.cargo/env - source $HOME/.cargo/env

View File

@ -5,8 +5,9 @@ unittests:
tags: tags:
- veloren-docker - veloren-docker
script: script:
- 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 || ( sleep 10 && cargo test ) || ( sleep 10 && cargo test ) || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test retry:
max: 2
coverage: coverage:
stage: build-post stage: build-post
@ -16,8 +17,9 @@ coverage:
tags: tags:
- veloren-docker - veloren-docker
script: script:
- echo "Workaround, tarpaulin fails due some rust files are already deleted, so we just stack tarpaulin. if its the os error, it wont appear on them all, if its a real error, it will retry and then fail" - cargo tarpaulin -v
- cargo tarpaulin -v || ( sleep 10 && cargo tarpaulin -v ) || ( sleep 10 && cargo tarpaulin -v ) || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v retry:
max: 2
benchmarks: benchmarks:
stage: build-post stage: build-post
@ -28,6 +30,8 @@ benchmarks:
script: script:
- unset DISABLE_GIT_LFS_CHECK - unset DISABLE_GIT_LFS_CHECK
- cargo bench - cargo bench
retry:
max: 2
localization-status: localization-status:
variables: variables:
@ -41,7 +45,9 @@ localization-status:
script: script:
- cargo test -q test_all_localizations -- --nocapture --ignored - cargo test -q test_all_localizations -- --nocapture --ignored
linux: # Artifacts
.artifact: &artifact
stage: build-post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
@ -52,6 +58,9 @@ linux:
- /^master$/ - /^master$/
tags: tags:
- veloren-docker - veloren-docker
linux:
<<: *artifact
script: script:
- cargo build --release - cargo build --release
- cp -r target/release/veloren-server-cli $CI_PROJECT_DIR - cp -r target/release/veloren-server-cli $CI_PROJECT_DIR
@ -67,16 +76,7 @@ linux:
expire_in: 1 week expire_in: 1 week
windows: windows:
stage: build-post <<: *artifact
when: delayed
start_in: 5 seconds
only:
refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+/
- /^master$/
tags:
- veloren-docker
script: script:
- cargo build --target=x86_64-pc-windows-gnu --release - 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 - cp -r target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe $CI_PROJECT_DIR
@ -90,16 +90,7 @@ windows:
expire_in: 1 week expire_in: 1 week
macos: macos:
stage: build-post <<: *artifact
when: delayed
start_in: 5 seconds
only:
refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+/
- /^master$/
tags:
- veloren-docker
script: script:
- 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 - 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
- cp -r target/x86_64-apple-darwin/release/veloren-server-cli $CI_PROJECT_DIR - cp -r target/x86_64-apple-darwin/release/veloren-server-cli $CI_PROJECT_DIR