forked from GridTools/gt4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
98 lines (87 loc) · 2.08 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
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.cscs.yml'
.py39: &py39
PYVERSION_PREFIX: py39
PYVERSION: 3.9.1
.py38: &py38
PYVERSION_PREFIX: py38
PYVERSION: 3.8.5
.status: &status
STATUS_IMAGE: dropd/github-status:latest
stages:
- notifystart
- image
- test
- cleanup
notify_github_pending:
stage: notifystart
only: ["master", "staging", "trying"]
tags: ["kubernetes"]
image: $STATUS_IMAGE
script: ./ci/set_github_status.sh pending
variables:
<<: *status
build py38:
extends: .dind
stage: image
variables:
BUILD_IMAGE: $CSCS_REGISTRY_IMAGE/gt4py-ci:$PYVERSION
<<: *py38
script:
- docker login -u $CSCS_REGISTRY_USER -p $CSCS_REGISTRY_PASSWORD $CSCS_REGISTRY
- docker pull $BUILD_IMAGE || echo "has not been built yet"
- docker build --network=host --cache-from $BUILD_IMAGE --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PYVERSION=$PYVERSION --build-arg CI_PROJECT_DIR=$CI_PROJECT_DIR -t $BUILD_IMAGE .
- docker push $BUILD_IMAGE
only:
- master
- staging
- trying
build py39:
allow_failure: true
extends: build py38
variables:
<<: *py39
test py38:
extends: .daint
only:
- master
- staging
- trying
needs: ["build py38"]
stage: test
image: $CSCS_REGISTRY_IMAGE/gt4py-ci:$PYVERSION
script:
- python -c "import cupy"
- pip install clang-format
- tox --sitepackages -r -e $PYVERSION_PREFIX-internal-cuda101
variables:
CRAY_CUDA_MPS: 1
PULL_IMAGE: "YES"
SLURM_CONSTRAINT: gpu
SLURM_JOB_NUM_NODES: 1
SLURM_TIMELIMIT: 120
<<: *py38
test py39:
allow_failure: true
extends: test py38
needs: ["build py39"]
variables:
<<: *py39
notify_github_success:
stage: cleanup
when: on_success
only: ["master", "staging", "trying"]
tags: ["kubernetes"]
image: $STATUS_IMAGE
script: ./ci/set_github_status.sh success
variables:
<<: *status
notify_github_failure:
stage: cleanup
when: on_failure
only: ["master", "staging", "trying"]
tags: ["kubernetes"]
image: $STATUS_IMAGE
script: ./ci/set_github_status.sh failure
variables:
<<: *status