veloren/.gitlab-ci.yml
Marcel Märtens edce01c336 implement a new tag system for all veloren runners, including
- project tag:
   - `veloren/veloren`: for the veloren repo only
   - `veloren/*`: for projects thats are in the veloren namespace, e.g. usefull for smaller projects that dont have their own tag
   - `*/*` for projects by 3rd parties, e.g. personal projects
 - trusted tag:
   - `owned`:  The runner is hosted on veloren hardware
   - `trusted`: The runner is hosted by a private person, trusted by the veloren devs
   - NONE: if no special trust is given in a runner
 - check/build tag:
   - `check`: a job only performs a check and NO executable is build for users
   - `build`: the job contains atleast 1 executable that can be run by users
   - NONE: neither a check nor a executable is build, e.g. usefull for pages or meta jobs
 - publish tag:
   - `publish`: this job produces a artifact that is automatically pushed to users
   - NONE: no artifact is pushed automatically to users
 - pin tags:
   - `benchmark`: pin a runner to a specific job for the cause of benchmarks
   - `veloren/*:macos`: runs on a native macos runner ONLY, this needs to be a modified project tag, as otherwise also normal checks would run on this runner.
   - NONE: no runner is pinned
2021-08-19 09:23:31 +02:00

53 lines
1.5 KiB
YAML

stages:
- check
- build-nightly
- build
- 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!
# https://docs.gitlab.com/ee/ci/yaml/#shallow-cloning
GIT_DEPTH: 3
GIT_CLEAN_FLAGS: -f
CACHE_IMAGE_TAG: 5d0b61ad
default:
# 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
tags:
- veloren/veloren
# NOTE: overriden for the `.tmacos` template so relevant changes need to be mirrored there
before_script:
- source $HOME/.cargo/env
- df -h /
- free -h
- cargo --version
- source ./.gitlab/scripts/env.sh
- rm -rf target || echo "it seems that sometimes OLD data is left over"
# 8866215 is the user that is used to sync data to the collaboration repos
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $GITLAB_USER_ID != "8866215"
- if: $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ && $GITLAB_USER_ID != "8866215"
include:
- local: .gitlab/CI/recompile.yml
- local: .gitlab/CI/release.yml
- local: .gitlab/CI/check.gitlab-ci.yml
- local: .gitlab/CI/build.gitlab-ci.yml
- local: .gitlab/CI/publish.gitlab-ci.yml