-
Notifications
You must be signed in to change notification settings - Fork 62
/
.gitlab-ci.yml
62 lines (57 loc) · 2.21 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
# SPDX-License-Identifier: GPL-2.0-only
stages:
- check
.pacman_install:
before_script:
# NOTE: Install latest archlinux-keyring before upgrading system. In the
# future this should not be needed anymore when we can guarantee a valid
# keyring for longer:
# https://gitlab.archlinux.org/archlinux/archlinux-keyring/-/issues/4
- echo -e "\e[0Ksection_start:`date +%s`:pacman[collapsed=true]\r\e[0KInstalling dependencies"
- pacman -Sy --needed --noconfirm archlinux-keyring
- pacman --noconfirm -Syu --needed bats bats-assert bats-support diffutils git jq kcov lzop meson pkg-config shellcheck systemd-ukify
- echo -e "\e[0Ksection_end:`date +%s`:pacman\r\e[0K"
- echo -e "\e[0Ksection_start:`date +%s`:useradd[collapsed=true]\r\e[0KCreating non-root user..."
- useradd -d /builds/${GITLAB_USER_LOGIN} -M builder
- chown -R builder:builder ..
- echo -e "\e[0Ksection_end:`date +%s`:useradd\r\e[0K"
shellcheck:
stage: check
extends: .pacman_install
script:
- sudo -HEu builder meson setup build -Ddocs=false
- sudo -HEu builder meson test -C build --suite shellcheck
tags:
- vm
test:
stage: check
extends: .pacman_install
script:
- sudo -HEu builder meson setup build -Ddocs=false
- sudo -HEu builder meson test -C build --suite bats
artifacts:
reports:
junit: build/meson-logs/testlog.junit.xml
tags:
- vm
coverage:
stage: check
extends: .pacman_install
coverage: '/Percent covered\s+\d+\.\d+/'
allow_failure: true
script:
- sudo -HEu builder meson setup build -Ddocs=false
- sudo -HEu builder meson test -C build --suite coverage
- jq -r '. |
["Percent covered", .percent_covered],
["Covered lines", .covered_lines],
["Total lines", .total_lines],
["Percent low", .percent_low],
["Percent high", .percent_high] | @tsv' build/coverage/kcov-merged/coverage.json
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage/kcov-merged/cobertura.xml
tags:
- vm