-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
154 lines (145 loc) · 4.6 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
154 lines (145 loc) · 4.6 KB
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
stages:
- build
- release
variables:
PACKAGE_ENDPOINT: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic"
ALPINE_DEPS: "make gcc git scdoc musl-dev linux-headers openssl-dev zlib-dev lua5.3-dev lua5.3-lzlib cmocka-dev python3-dev"
ALPINE_STATIC_DEPS: "zlib-static openssl-libs-static"
KUBERNETES_CPU_REQUEST: 2
KUBERNETES_MEMORY_REQUEST: 256Mi
.build:alpine:
stage: build
image: alpinelinux/build-base:latest-$ARCH
script:
- if [ "$ARCH" = "x86_64" ]; then EXTRA="--repository=$(sed -ne 's/main/community/p' < /etc/apk/repositories) shellcheck"; fi
- abuild-apk add -u meson $ALPINE_DEPS $ALPINE_STATIC_DEPS zstd-dev zstd-static $EXTRA
- meson setup --auto-features=enabled build
- ninja -C build
- meson setup build-static -Dc_link_args=-static -Ddefault_library=static -Dprefer_static=true
- ninja -C build-static src/apk
- meson test -C build
- install -s -m0755 build-static/src/apk build-static/src/apk.static-$ARCH
artifacts:
when: always
paths:
- build/meson-logs/testlog.txt
- build-static/src/apk.static-*
reports:
junit: build/**/*.junit.xml
build:alpine:
extends: .build:alpine
parallel:
matrix:
- ARCH:
- x86
- x86_64
- armv7
- aarch64
- s390x
- ppc64le
- riscv64
tags:
- ci-build
- $ARCH
build:alpine-alt-config:
stage: build
image: alpinelinux/build-base:latest-x86_64
script:
- abuild-apk add -u meson $ALPINE_DEPS
- meson setup build -Durl_backend=wget -Dzstd=disabled
- ninja -C build
tags:
- ci-build
- x86_64
build:alpine-muon:
stage: build
image: alpinelinux/build-base:latest-x86_64
script:
- abuild-apk add -u muon $ALPINE_DEPS $ALPINE_STATIC_DEPS zstd-dev zstd-static
- muon setup -Dpython=disabled build
- ninja -C build
- muon setup -Dpython=disabled -Dc_link_args="-static" -Dprefer_static=true -Ddefault_library=static build-static
- ninja -C build-static src/apk
tags:
- ci-build
- x86_64
build:alpine-legacy:
stage: build
image: alpinelinux/build-base:latest-x86_64
script:
- abuild-apk add -u $ALPINE_DEPS zstd-dev
- make -j$(nproc) check
tags:
- ci-build
- x86_64
build:debian:
image: debian
stage: build
script:
- apt-get update
- apt-get install -y make gcc git libssl-dev zlib1g-dev libzstd-dev lua5.3-dev lua5.2 lua-zlib-dev sudo meson
- unlink /bin/sh
- ln -s /bin/bash /bin/sh
- meson setup build
- ninja -C build
tags:
- ci-build
- x86_64
build:fedora:
image: registry.fedoraproject.org/fedora:latest
stage: build
script:
- dnf -y install diffutils meson gcc git-core lua-zlib 'pkgconfig(cmocka)' 'pkgconfig(libzstd)' 'pkgconfig(lua)' 'pkgconfig(openssl)' 'pkgconfig(python3)' 'pkgconfig(scdoc)' 'pkgconfig(zlib)'
- meson setup build -Dlua_version=5.4 -Dlua_bin=lua -Dlua_pc=lua
- meson compile -C build
- meson test -C build
artifacts:
when: always
paths:
- build/meson-logs/testlog.txt
reports:
junit: build/**/*.junit.xml
tags:
- ci-build
- x86_64
publish-static:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- |-
apk add curl
for artifact in build-static/src/apk.static-*; do
! [ -f "$artifact" ] && { echo "No artifacts found"; exit 1; }
ARCH=${artifact##*-}
echo "Uploading binary for $ARCH"
curl --fail -H "JOB-TOKEN: $CI_JOB_TOKEN" -T "$artifact" -o /dev/null ${PACKAGE_ENDPOINT}/$CI_COMMIT_TAG/$ARCH/apk.static
done
- echo "Publishing release binaries"
release:
name: $CI_COMMIT_TAG
description: "Release $CI_COMMIT_TAG"
tag_name: $CI_COMMIT_TAG
ref: $CI_COMMIT_TAG
assets:
links:
- name: apk.static (x86_64)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/x86_64/apk.static
- name: apk.static (x86)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/x86/apk.static
- name: apk.static (armv7)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/armv7/apk.static
- name: apk.static (armhf)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/armhf/apk.static
- name: apk.static (aarch64)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/aarch64/apk.static
- name: apk.static (s390x)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/s390x/apk.static
- name: apk.static (ppc64le)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/ppc64le/apk.static
- name: apk.static (riscv64)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/riscv64/apk.static
rules:
- if: $CI_COMMIT_TAG
tags:
- docker-alpine
- ci-fast