forked from Beckhoff/ADS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
172 lines (154 loc) · 4.4 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
stages:
- build
- test
- release-push
cache:
paths:
- apt-cache/
.build-meson:
stage: build
script:
- meson setup build ${BHF_CI_MESON_OPTIONS}
- ninja -C build
- meson setup example/build example ${BHF_CI_MESON_OPTIONS}
- ninja -C example/build
artifacts:
when: always
paths:
- AdsLib/**/*.h
- build/
- example/build/
.build-meson-docker:
extends: .build-meson
tags:
- docker
image: ${REGISTRY_HOST}/beckhoff/docker-mxe:40549
build-linux-clang:
extends: .build-meson-docker
variables:
CXX: clang++
build-fbsd-clang:
extends: .build-meson
tags:
- tcbsd
before_script:
- doas pkg install -y meson
# we dont limit grep --max-count=1, because curl would complain if grep closes the pipe
- curl https://tcbsd.beckhoff.com/TCBSD/12/stable/packages/All/ | grep --only-matching -e "href='.*ADS-Comm-Lib.*'" | cut -d "'" -f 2 | xargs -I{} fetch https://tcbsd.beckhoff.com/TCBSD/12/stable/packages/All/{}
- doas pkg install -y -f TF6000-ADS-Comm-Lib-*
variables:
BHF_CI_MESON_OPTIONS: '-Dtcadsdll_include=/usr/local/include -Dtcadsdll_lib=/usr/local/lib'
build-linux-gcc:
extends: .build-meson-docker
build-linux-gcc-i386:
extends: .build-meson-docker
variables:
BHF_CI_MESON_OPTIONS: '--cross-file meson.cross.amd64-linux.i386'
build-linux-gcc-mips:
extends: .build-meson-docker
variables:
BHF_CI_MESON_OPTIONS: '--cross-file meson.cross.amd64-linux.mips'
before_script:
- apt update -y && apt install -y g++-mips-linux-gnu
build-mxe:
extends: .build-meson-docker
variables:
BHF_CI_MESON_OPTIONS: '--cross-file meson.cross.amd64-linux.win32 -Dcpp_std=c++14 -Db_pie=false'
build-win10:
extends: .build-meson
tags:
- MD_TWINCAT_XAE
before_script:
- C:\ProgramData\chocolatey\bin\choco install --no-progress -y meson ninja
- $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
- $env:BHF_CI_MESON_OPTIONS = '-Dtcadsdll_include=c:\TwinCAT\AdsApi\TcAdsDll\Include', '-Dtcadsdll_lib=c:\TwinCAT\AdsApi\TcAdsDll\x64\lib'
.test-linux:
stage: test
image: ${REGISTRY_HOST}/beckhoff/test_stage/test_runner:4.5
tags:
- docker_vm_runner
- few_vcpus
services:
- name: ${REGISTRY_HOST}/beckhoff/build-linuxum:patrickbr-docker-adslib
alias: ads-server
variables:
EXPECTED_PLATFORMID: 92
EXPECTED_SYSTEMID: '95EEFDE0-0392-1452-275F-1BF9ACCB924E'
script:
- apt update -y && apt install -y socat xxd
- ./tools/90_run_tests.sh
test-linux-clang:
extends: .test-linux
needs: [
"build-linux-clang",
]
test-linux-gcc:
extends: .test-linux
needs: [
"build-linux-gcc",
]
test-linux-gcc-i386:
extends: .test-linux
needs: [
"build-linux-gcc-i386",
]
before_script:
- dpkg --add-architecture i386
- apt update -y && apt install -y libc6:i386 libstdc++6:i386
test-linux-gcc-mips:
extends: .test-linux
needs: [
"build-linux-gcc-mips",
]
variables:
QEMU_LD_PREFIX: '/usr/mips-linux-gnu'
before_script:
- apt update -y && apt install -y binfmt-support libstdc++-dev-mips-cross qemu-user-binfmt
# TODO remove as soon as we won't require privileged containers for TC anymore
- update-binfmts --enable qemu-mips
- update-binfmts --disable qemu-mipsn32
test-fbsd-clang:
stage: test
needs: [
"build-fbsd-clang",
]
tags:
- adslib
- tcbsd
variables:
BHF_CI_NAT_IP: '172.17.62.71'
EXPECTED_PLATFORMID: 90
EXPECTED_SYSTEMID: 'E5898A06-9629-71CC-8474-DD555071C0EB'
before_script:
- echo "172.17.66.104 ads-server" | doas tee -a /etc/hosts
- nc -z 172.17.66.104 48897
- sleep 10
script:
- doas pkg install -y vim
- ./tools/90_run_tests.sh
build-debian:
image: ${REGISTRY_HOST}/beckhoff/bdpg:master
stage: build
before_script:
- apt-get update && apt-get install -y --no-install-recommends meson
script:
- bdpg build
artifacts:
expire_in: 1 week
when: always
paths:
- ./debian-release
release-push:
image: ${REGISTRY_HOST}/beckhoff/bdpg:master
stage: release-push
dependencies:
- build-debian
only:
refs:
- master
script:
- mkdir -p "/root/.ssh"
- printf '%s\n' "Host *" > /root/.ssh/config
- printf '\t%s\n' "StrictHostKeyChecking no" "UserKnownHostsFile /dev/null" >> /root/.ssh/config
- .ci/publish_debian_package.sh
allow_failure: true