-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
150 lines (141 loc) · 4.16 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
stages:
- pre-build
- build
.rules:
rules:
# --
# Rule to fall back on...
- &default
when: always
# --
# Only run when the commit **DOES NOT** contains "[ascent-rebuild]"
- &rule_no_ascent_rebuild
if: '$CI_COMMIT_TITLE =~ /\[ascent-rebuild\]/'
when: never
# Only run when the commit **DOES NOT** contains "[ascent-test]"
- &rule_no_ascent_test
if: '$CI_COMMIT_TITLE =~ /\[ascent-test\]/'
when: never
# Only run when the commit **DOES** contains "[ascent-test]"
- &rule_yes_ascent_test
if: '$CI_COMMIT_TITLE =~ /\[ascent-test\]/'
when: always
# --
# Only run when the commit **DOES NOT** contains "[deception-test]"
- &rule_no_deception_test
if: '$CI_COMMIT_TITLE =~ /\[deception-test\]/'
when: never
# Only run when the commit **DOES NOT** contains "[deception-rebuild]"
- &rule_no_deception_rebuild
if: '$CI_COMMIT_TITLE =~ /\[deception-rebuild\]/'
when: never
# Only run when the commit **DOES NOT** contains "[incline-rebuild]"
- &rule_no_incline_rebuild
if: '$CI_COMMIT_TITLE =~ /\[incline-rebuild\]/'
when: never
# Only run when the commit **DOES NOT** contains "[incline-test]"
- &rule_no_incline_test
if: '$CI_COMMIT_TITLE =~ /\[incline-test\]/'
when: never
# Ascent Variables
.ornl_environment_template:
variables:
SCHEDULER_PARAMETERS: "-P CSC359 -nnodes 1 -W 120"
WORKDIR: /gpfs/wolf/proj-shared/csc359/ci/${CI_PIPELINE_ID}
Ascent-Build-Test:
stage: build
rules:
- *rule_no_ascent_rebuild
- *rule_yes_ascent_test
- *rule_no_deception_rebuild
- *rule_no_deception_test
- *rule_no_incline_rebuild
- *rule_no_incline_test
- *default
tags:
- batch
extends: .ornl_environment_template
script:
- set -xv
- mkdir -p "$WORKDIR"
- cp -r . "$WORKDIR"
- cd "$WORKDIR"
- export srcdir=$WORKDIR builddir=$WORKDIR/build installdir=$WORKDIR/install
- MY_CLUSTER=ascent ./buildsystem/build.sh
- res=$?
- exit $res
after_script:
- cd "$WORKDIR/.."
- rm -rf "$WORKDIR"
Ascent-Module-Init:
extends: .ornl_environment_template
variables:
GIT_SUBMODULE_STRATEGY: recursive
rules:
- if: '$CI_COMMIT_TITLE =~ /\[ascent-rebuild\]/'
when: always
stage: pre-build
tags:
- nobatch
script:
- set -xv
- mkdir -p "$WORKDIR"
- cp -r . "$WORKDIR"
- cd "$WORKDIR"
- MY_CLUSTER=ascent ./buildsystem/init-mirror.sh
- res=$?
- exit $res
Ascent-Module-Build:
needs: ["Ascent-Module-Init"]
rules:
- if: '$CI_COMMIT_TITLE =~ /\[ascent-rebuild\]/'
when: always
extends: .ornl_environment_template
stage: build
tags:
- batch
script:
- cd "$WORKDIR"
- git checkout -b ${CI_COMMIT_REF_NAME}
- ./buildsystem/spack/ascent/install.sh
- git add ./buildsystem/spack/ascent/modules/*
- git config user.name "spack-auto-module"
- git config user.email "[email protected]"
- git commit -m "Update Ascent spack built tcl modules [ascent-test]"
- git remote set-url origin https://gitlab-ci-token:${SPACK_GIT_TOKEN}@github.com/ORNL/ReSolve.git
- git pull --rebase origin ${CI_COMMIT_REF_NAME}
- git push origin ${CI_COMMIT_REF_NAME}
after_script:
- cd "$WORKDIR/.."
- rm -rf "$WORKDIR"
.report-status:
variables:
GIT_STRATEGY: none
STATUS_PROJECT: ORNL/ReSolve
MY_CLUSTER: Ascent
tags:
- nobatch
extends:
- .ornl_environment_template
script:
# For complete details on the GitLab API please see:
# https://docs.gitlab.com/ee/api/commits.html#post-the-build-status-to-a-commit
# Make sure to create the token with Developer level access and API scope
- |
curl -L -X POST -H @${GITHUB_CURL_HEADERS} https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}"
environment:
name: reporting-gitlab
pending:
extends:
- .report-status
stage: .pre
success:
stage: .post
extends:
- .report-status
failure:
stage: .post
extends:
- .report-status
rules:
- when: on_failure