File: .gitlab-ci.yml

package info (click to toggle)
tango 10.0.2%2Bdfsg1-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 89,480 kB
  • sloc: cpp: 201,245; sh: 1,645; python: 953; java: 800; perl: 467; javascript: 447; xml: 325; makefile: 269; sql: 72; ruby: 24
file content (235 lines) | stat: -rw-r--r-- 7,126 bytes parent folder | download | duplicates (2)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
---
variables:
  TANGO_VERSION: 9.4.1
  MSVC_VERSION: v141
  GENERATOR_VERSION: Visual Studio 16 2019
  DEPS_PATH: C:/dependencies
  LIBTANGO: libtango_${TANGO_VERSION}_${MSVC_VERSION}_${ARCH}_static_release
  TANGO_PATH: ${DEPS_PATH}/${LIBTANGO}
  PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}"
  CMAKE_BUILD_TYPE: Debug
  DEBIAN_FRONTEND: noninteractive

# See: https://docs.gitlab.com/ce/ci/yaml/README.html#workflowrules-templates
workflow:
  rules:
    - if: $CI_MERGE_REQUEST_IID
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# Not possible with parallel, see https://gitlab.com/gitlab-org/gitlab/-/issues/254821
.build-cppTango:
  image: debian:bullseye
  tags:
    - docker, linux, amd64
  before_script:
    - apt-get update
    - >
      apt-get install -y
      build-essential
      cmake
      git
      libcos4-dev
      libomniorb4-dev
      libomnithread4-dev
      libzmq3-dev
      omniidl
      pkg-config
    # Install tango-idl
    - git clone --depth 1 https://gitlab.com/tango-controls/tango-idl.git /idl
    - cmake -B /idl/build -DCMAKE_INSTALL_PREFIX=/usr/local/tango-idl /idl
    - make -C /idl/build install
    # Install cppzmq
    - git clone -b v4.7.1 --depth 1 https://github.com/zeromq/cppzmq.git /cppzmq
    - cmake -B /cppzmq/build -DCPPZMQ_BUILD_TESTS=OFF /cppzmq
    - make -C /cppzmq/build install
    # Clone cppTango
    - git clone -b ${BRANCH} --depth 1 https://gitlab.com/tango-controls/cppTango.git /cppTango
    - >
      cmake -B /cppTango/build
      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
      -DBUILD_TESTING=OFF
      -DTANGO_IDL_BASE=/usr/local/tango-idl
      -DIDL_BASE=/usr/local/tango-idl
      -DTANGO_USE_JPEG=OFF
      -DTANGO_USE_USING_NAMESPACE=OFF
      /cppTango
  script:
    - make -C /cppTango/build install
    - tar cf usr-local.tar /usr/local
  artifacts:
    when: on_success
    paths:
      - usr-local.tar

build-cppTango-main:
  extends: .build-cppTango
  variables:
    BRANCH: main

build-cppTango-9.3-backports:
  extends: .build-cppTango
  variables:
    BRANCH: 9.3-backports

.build-tangotest-win:
  rules:
    - if: '$ARCH == "x64"'
      variables:
        DOWNLOAD_URL: "https://gitlab.com/tango-controls/cppTango/-/package_files/67360212/download"
    - if: '$ARCH == "x86"'
      variables:
        DOWNLOAD_URL: "https://gitlab.com/tango-controls/cppTango/-/package_files/67361143/download"
  before_script:
    - choco install cmake curl -y
    - $env:Path += ";C:\Program Files\CMake\bin"
    - $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
    - msbuild /version
    - if (Test-Path "${DEPS_PATH}") { Remove-Item "${DEPS_PATH}" -Recurse -Force; }
    - New-Item "${DEPS_PATH}" -ItemType Directory
      # See LIBTANGO constant at the top for the exact name
    - curl.exe -qLS "${DOWNLOAD_URL}" -o "${DEPS_PATH}/download"
    - 7z x "${DEPS_PATH}/download" -o"${DEPS_PATH}"
  script:
    - New-Item build -ItemType Directory
    - cd build
    - cmake -G"${GENERATOR_VERSION}" -A"${PLATFORM}" .. -DTango_ROOT="${TANGO_PATH}" -DTango_FORCE_STATIC=ON
    - cmake --build . --config Release
    - cmake --install .
  after_script:
    - New-Item artifacts -ItemType Directory
    - if (Test-Path "C:\Program Files\TangoTest\bin") { Move-Item -Path "C:\Program Files\TangoTest\bin\TangoTest.exe" -Destination "artifacts\TangoTest-x64.exe"; }
    - if (Test-Path "C:\Program Files (x86)\TangoTest\bin") { Move-Item -Path "C:\Program Files (x86)\TangoTest\bin\TangoTest.exe" -Destination "artifacts\TangoTest-x86.exe"; }
  artifacts:
    paths:
      - artifacts
    expire_in: 1 day
  tags:
    - shared-windows

build-tangotest-win-64bit:
  extends: .build-tangotest-win
  variables:
    ARCH: x64
    PLATFORM: x64

build-tangotest-win-32bit:
  extends: .build-tangotest-win
  variables:
    ARCH: x86
    PLATFORM: Win32

.build-tangotest-linux:
  image: debian:bullseye
  tags:
    - docker, linux, amd64
  before_script:
    - apt-get update
    - >
      apt-get install -y
      build-essential
      cmake
      git
      libcos4-dev
      libomniorb4-dev
      libomnithread4-dev
      libzmq3-dev
      omniidl
      pkg-config
    - mkdir build

build-tangotest-linux-main:
  extends: .build-tangotest-linux
  needs:
    - build-cppTango-main
  script:
    - tar xf usr-local.tar -C /
    - cmake -DTANGO_WARNINGS_AS_ERRORS=ON -B build .
    - make -C build install

build-tangotest-linux-9.3-backports:
  extends: .build-tangotest-linux
  needs:
    - build-cppTango-9.3-backports
  script:
    - tar xf usr-local.tar -C /
    - cmake -B build .
    - make -C build install

build-tangotest-linux-stock:
  extends: .build-tangotest-linux
  script:
    - apt-get install -y libtango-dev
    - cmake -B build .
    - make -C build install

build-tangotest-linux-main-newest-supported-cmake:
  extends: .build-tangotest-linux
  needs:
    - build-cppTango-main
  script:
    # Extract tango
    - tar xf usr-local.tar -C /
    # Install custom cmake
    - apt-get install curl
    - apt-get remove -y cmake
    - curl -L https://cmake.org/files/v3.26/cmake-3.26.4-linux-x86_64.sh -o /tmp/cmake-install.sh
    - chmod +x /tmp/cmake-install.sh
    - cd /usr/local
    - /tmp/cmake-install.sh --skip-license --exclude-subdir
    # Build DS
    - cd ${CI_PROJECT_DIR}
    - cmake -Werror=dev -DTANGO_WARNINGS_AS_ERRORS=ON -B build .
    - make -C build install

build-tangotest-linux-main-oldest-supported-cmake:
  extends: .build-tangotest-linux
  needs:
    - build-cppTango-main
  script:
    # Extract tango
    - tar xf usr-local.tar -C /
    # Install custom cmake
    - apt-get install curl
    - apt-get remove -y cmake
    - curl -L https://cmake.org/files/v3.18/cmake-3.18.6-Linux-x86_64.sh -o /tmp/cmake-install.sh
    - chmod +x /tmp/cmake-install.sh
    - cd /usr/local
    - /tmp/cmake-install.sh --skip-license --exclude-subdir
    # Build DS
    - cd ${CI_PROJECT_DIR}
    - cmake -Werror=dev -DTANGO_WARNINGS_AS_ERRORS=ON -B build .
    - make -C build install

release-builds:
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  tags:
    - docker, linux, amd64
  needs:
    - build-tangotest-linux-stock
    - build-tangotest-linux-9.3-backports
    - build-tangotest-linux-main
    - build-tangotest-win-32bit
    - build-tangotest-win-64bit
  before_script:
    - apk update
    - apk add curl
    - apk --no-cache add findutils
  script:
    - cd artifacts
    - >
      find . -type f -printf "%f\n" -exec curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file {} "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/{}" \;
  release:
    name: 'Release $CI_COMMIT_TAG'
    tag_name: '$CI_COMMIT_TAG'
    description: 'Release $CI_COMMIT_TAG'
    ref: '$CI_COMMIT_SHA'
    assets:
      links:
        - name: 'TangoTest-x64.exe'
          url: "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/TangoTest-x64.exe"
        - name: 'TangoTest-x86.exe'
          url: "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/TangoTest-x86.exe"
  rules:
    - if: $CI_COMMIT_TAG
      when: on_success