-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
114 lines (95 loc) · 2.33 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
102
103
104
105
106
107
108
109
110
111
112
113
114
stages:
- lint
- build
- deploy
- package
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
.build_cache:
cache_rw:
key: common-ci-cache
paths:
- .cache/pip/
policy: pull-push
cache_ro:
key: common-ci-cache
paths:
- .cache/pip/
policy: pull
# static source code analysis
lint:
stage: lint
image: europeanxfel/karabo-ci:miniconda-3lint
script:
- source ci/lint
only:
- branches
except:
- master
.unit_tests: &unit-tests-conda
cache: !reference [ .build_cache, cache_rw ]
stage: build
script:
- python ci/build.py extensions --clean --test
only:
- branches
except:
- master
.release_build: &release-build
cache: !reference [ .build_cache, cache_rw ]
stage: build
variables:
TWINE_USERNAME: gitlab-ci-token
TWINE_PASSWORD: $CI_JOB_TOKEN
UPLOAD_URL: $CI_API_V4_URL/projects/4562/packages/pypi
script:
- python ci/build.py extensions --clean --test --upload-wheel -P karaboExtensions/tags
- python -m pip install twine --upgrade
- cd dist
- >
for FILE in *.whl; do
echo "Uploading to XFEL package registry: $FILE"
# when an upload fails (400: bad request), it is because the package already exists
# the '|| true' follows this command to ignore upload failures
python3 -m twine upload --disable-progress-bar --skip-existing --repository-url $UPLOAD_URL $FILE || true
done
only:
- /^(\d+\.)(\d+\.?)(\d+)$/
except:
- branches
- schedules
.nightly_build_conda: &nightly-test-conda
cache: !reference [ .build_cache, cache_rw ]
stage: build
script:
- python ci/build.py extensions --clean --test --nightly
only:
- schedules
##### Release build #####
release build miniconda:
image: europeanxfel/karabo-ci:miniconda-3
<<: *release-build
##### Test build #####
unit tests miniconda:
image: europeanxfel/karabo-ci:miniconda-3
<<: *unit-tests-conda
unit tests miniconda-osx64:
before_script:
- ci/cleanup.sh
tags:
- macos
<<: *unit-tests-conda
unit tests miniconda-win64:
before_script:
- ci/cleanup.cmd
tags:
- Win10
<<: *unit-tests-conda
##### Nightly build ####
nightly test miniconda:
image: europeanxfel/karabo-ci:miniconda-3
<<: *nightly-test-conda
include:
- project: karabo/gitlabci
file: .mirror-device.yml
ref: main