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
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
# Note: this is deprecated!
# ttps://docs.gitlab.com/ee/ci/yaml/#shallow-cloning
GIT_DEPTH: 3
GIT_CLEAN_FLAGS: -f
@ -13,7 +18,12 @@ default:
image: registry.gitlab.com/veloren/veloren-docker-ci:latest
# 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
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
before_script:
- source $HOME/.cargo/env

View File

@ -5,8 +5,9 @@ unittests:
tags:
- veloren-docker
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 || ( 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
- cargo test
retry:
max: 2
coverage:
stage: build-post
@ -16,8 +17,9 @@ coverage:
tags:
- veloren-docker
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 || ( 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
- cargo tarpaulin -v
retry:
max: 2
benchmarks:
stage: build-post
@ -28,6 +30,8 @@ benchmarks:
script:
- unset DISABLE_GIT_LFS_CHECK
- cargo bench
retry:
max: 2
localization-status:
variables:
@ -41,7 +45,9 @@ localization-status:
script:
- cargo test -q test_all_localizations -- --nocapture --ignored
linux:
# Artifacts
.artifact: &artifact
stage: build-post
when: delayed
start_in: 5 seconds
@ -52,6 +58,9 @@ linux:
- /^master$/
tags:
- veloren-docker
linux:
<<: *artifact
script:
- cargo build --release
- cp -r target/release/veloren-server-cli $CI_PROJECT_DIR
@ -67,16 +76,7 @@ linux:
expire_in: 1 week
windows:
stage: build-post
when: delayed
start_in: 5 seconds
only:
refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+/
- /^master$/
tags:
- veloren-docker
<<: *artifact
script:
- 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
@ -90,16 +90,7 @@ windows:
expire_in: 1 week
macos:
stage: build-post
when: delayed
start_in: 5 seconds
only:
refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+/
- /^master$/
tags:
- veloren-docker
<<: *artifact
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
- cp -r target/x86_64-apple-darwin/release/veloren-server-cli $CI_PROJECT_DIR