-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
101 lines (86 loc) · 2.45 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
default:
image: python:3.11
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# https://pip.pypa.io/en/stable/topics/caching/
cache:
paths:
- .cache/pip
before_script:
- |
python --version ; pip --version # For debugging
pip install -r requirements.txt
git log --graph --abbrev-commit --oneline --all --decorate
stages:
- build
- test
- tide
# --- standard tide configuration below here ---
.common_rules:
# provided for convenience: not used by tide
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_REF_PROTECTED == "true"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
.tide-base:
stage: tide
before_script:
- env
- pip install -e .
auto-tag:
extends: .tide-base
script: tide autotag --annotation "$TIDE_AUTOTAG_ANNOTATION"
# must be performed serially, in order.
resource_group: $CI_PROJECT_PATH_SLUG-$CI_COMMIT_BRANCH
variables:
TIDE_AUTOTAG_ANNOTATION: $CI_COMMIT_TITLE
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_TAG
when: never
# tide init ensures that our gitflow branches are protected
- if: $CI_COMMIT_REF_PROTECTED == "true"
hotfix:
extends: .tide-base
# always runs last
stage: .post
# it's ok if hotfix does not succeed
allow_failure: true
script: tide hotfix
# must be performed serially, in order.
resource_group: $CI_PROJECT_PATH_SLUG-$CI_COMMIT_BRANCH
rules:
# tide init ensures that $CI_DEFAULT_BRANCH is set to the most experimental branch
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_TAG || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $TIDE_SKIP_HOTFIX == "true"
when: never
# tide init ensures that our gitflow branches are protected
- if: $CI_COMMIT_REF_PROTECTED == "true"
promote:
extends: .tide-base
resource_group: promote
script: tide promote
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "promote"
# --- end standard tide configuration --
# debug:
# stage: build
# script: env
# build:
# extends:
# - .common_rules
# stage: build
# script: echo "Building!"
unit-tests:
extends:
- .common_rules
stage: test
script: echo "Testing!"
# script: nox -s unit_tests
smoke-tests:
extends:
- .common_rules
stage: test
script: echo "Testing!"
# script: nox -s smoke_tests