-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml
143 lines (125 loc) · 4.09 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
stages: [test, dist]
default:
interruptible: true
before_script:
- export DEBUG=3 WERROR=1 V=1 TESTFLAGS=-ct
- export CC="ccache ${CC:-gcc}"
# Ensure upstream "v*" tags are present, regardless of whether
# this job is running for a fork or the upstream repo
- git fetch https://gitlab.com/craigbarnes/dte.git 'refs/tags/v*:refs/tags/v*'
- make vars
.fragment-1:
script: &objsize_and_bench
- make DEBUG=0 && make installcheck
- strip dte && du -k -h dte
- tools/objsize.sh dte
- make bench DEBUG=0 CFLAGS=-O3
.test:
stage: test
needs: []
script:
- make
- cat build/gen/feature.h
- ldd dte
- make check
- make check LDFLAGS=-static
- *objsize_and_bench
alpine:
extends: .test
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-alpine
ubuntu:
extends: .test
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-ubuntu
rocky-8:
extends: .test
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-rocky-8
rocky-9:
extends: .test
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-rocky-9
debian-oldstable:
extends: .test
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-debian-oldstable
arch:
stage: test
needs: []
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-arch
script:
- make check-source check check-clang-tidy
- (cd build/ && test/test)
- *objsize_and_bench
debian-stable:
stage: test
needs: []
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-debian
script:
- make check CC='ccache clang'
- make check CC='ccache clang' LDFLAGS=-static
- make check CC='ccache gcc'
- make check CC='ccache gcc' LDFLAGS=-static
- make check
- make installcheck
# Ensure build works with no detected features (test fallbacks)
- cat build/gen/feature.h
- sed 's/ 1$/ 0/' build/gen/feature.h > build/gen/feature-tmp.h
- mv build/gen/feature-tmp.h build/gen/feature.h
- make check
- cat build/gen/feature.h
# Build with ARM cross-compilers
- make CC='ccache arm-linux-gnueabihf-gcc'
- make CC='ccache arm-linux-gnueabihf-gcc' LDFLAGS=-static
- make CC='ccache aarch64-linux-gnu-gcc'
- make CC='ccache aarch64-linux-gnu-gcc' LDFLAGS=-static
- make clean && make distcheck
- make bench DEBUG=0 CFLAGS=-O3
android:
stage: test
needs: []
image: registry.gitlab.com/craigbarnes/dockerfiles/android-ndk
script:
- make CC="$CC_AARCH64"
- cat build/gen/feature.h
- make CC="$CC_ARMV7A"
- make CC="$CC_I686"
- make CC="$CC_X86_64"
coverage:
stage: test
needs: []
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-alpine
artifacts:
expire_in: 30 days
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
script:
- make gcovr-xml
- awk -f tools/gcovr-txt.awk build/coverage.txt
.pages:
stage: dist
needs: []
image: registry.gitlab.com/craigbarnes/dockerfiles/cdev-arch
coverage: '/^ *lines\.*: *(\d+\.\d+\%) .*$/'
artifacts:
paths: [public]
expire_in: 60 days
name: dte-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA
script:
- make docs htmlgz-aux
- make gcovr-html
- make vars check CC=musl-gcc LDFLAGS=-static DEBUG=0 SANE_WCTYPE=1
- strip dte
- tools/objsize.sh dte
- ldd dte || true
- TARNAME="$(./dte -V | head -n1 | tr -- ' ' -)-linux-$(uname -m)"
- tar -czf "public/$TARNAME.tar.gz" dte docs/dte.1 docs/dterc.5 docs/dte-syntax.5
- ln -s "$TARNAME.tar.gz" public/dte-master-linux-$(uname -m).tar.gz
- tree public/
pages:
extends: .pages
rules:
- if: $CI_COMMIT_BRANCH == "master"
pages:non-master:
extends: .pages
rules:
- if: $CI_COMMIT_BRANCH != "master"