-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.gitlab-ci.yml
175 lines (161 loc) · 6.08 KB
/
base.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
173
174
175
stages:
- checksingle
- build
- test
- qa
- checkall
#workflow:
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event" || ($CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH=="master") || $TEST_ALL == "1" || $PROBABILITY
variables:
REPO_NAME: "hep-forge"
default:
image: apnpucky/gentoo-hep-forge:latest
.images: &images
IMAGE:
[
apnpucky/gentoo-hep-forge:latest,
# apnpucky/gentoo-hep-forge-unstable:latest,
]
.configgeneral:
interruptible: true
tags:
- $ARCH
before_script:
- mkdir -p /etc/portage/profile/
- echo "-python_targets_python3_12" >> /etc/portage/profile/use.mask
- mkdir /var/db/repos/apn && printf "[apn]\nlocation = /var/db/repos/apn\nsync-type = git\nsync-uri = https://gitlab.com/APN-Pucky/gentoo-apn.git" >> /etc/portage/repos.conf/apn.conf && emaint -r apn sync
- echo '*/*::apn * ~*' > /etc/portage/package.accept_keywords/apn
- emerge --sync || emaint -r ${REPO_NAME} sync
- emerge app-eselect/eselect-repository
- eselect repository enable science && emaint -r science sync
- pushd /var/db/repos/${REPO_NAME} && git remote set-branches origin '*' && git fetch -v --depth=1 && git pull --unshallow && git checkout ${CI_COMMIT_SHA} && popd
- ACCEPT_KEYWORDS="* ~*" emerge -q '>=app-portage/pkg-testing-tools-0.2.1'
- ACCEPT_KEYWORDS="**" emerge -q '=app-portage/pkg-testing-tools-9999'
- echo 'dev-util/hermes ~*' >> /etc/portage/package.accept_keywords/zz-autoaccept
- echo 'dev-python/uncertainties ~*' >> /etc/portage/package.accept_keywords/zz-autoaccept
- echo 'dev-python/toposort ~*' >> /etc/portage/package.accept_keywords/zz-autoaccept
- echo 'sci-physics/root ~*' >> /etc/portage/package.accept_keywords/zz-autoaccept
- echo "*/*::${REPO_NAME} ~*" > /etc/portage/package.accept_keywords/${REPO_NAME}
- echo '>=media-libs/libafterimage-1.20-r6 png gif tiff jpeg' >> /etc/portage/package.use/root
- echo "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME} **" >> /etc/portage/package.accept_keywords/${REPO_NAME}
.configall:
extends: .configgeneral
rules:
- changes:
- "$CATEGORY/$PKG/$PKG-$VERSION*.ebuild"
- "$CATEGORY/$PKG/metadata.xml"
- "$CATEGORY/$PKG/Manifest"
- "$CATEGORY/$PKG/files/*"
- "$CATEGORY/$PKG/.build"
- ".build"
.config:
extends: .configgeneral
rules:
- changes:
- "$CATEGORY/$PKG/$PKG-$VERSION*.ebuild"
- "$CATEGORY/$PKG/metadata.xml"
- "$CATEGORY/$PKG/Manifest"
- "$CATEGORY/$PKG/files/*"
- "$CATEGORY/$PKG/.build"
- ".build"
#local-pkgcheck:
# image: apnpucky/gentoo-ebuild-ci
# stage: checkall
# tags:
# - amd64
# before_script:
# - emerge app-eselect/eselect-repository
# - eselect repository enable science && emaint -r science sync
# script:
# - pkgcheck scan --exit --quiet
# allow_failure: true
#
#global-pkgcheck:
# image: apnpucky/gentoo-ebuild-ci
# stage: checkall
# tags:
# - amd64
# before_script:
# - emerge app-eselect/eselect-repository
# - eselect repository enable science && emaint -r science sync
# - echo '*/*::science ~*' > /etc/portage/package.accept_keywords/science
# - echo "[${REPO_NAME}]">> /etc/portage/repos.conf/${REPO_NAME}.conf
# - echo "location = /var/db/repos/${REPO_NAME}" >> /etc/portage/repos.conf/${REPO_NAME}.conf
# - echo "sync-type = git" >> /etc/portage/repos.conf/${REPO_NAME}.conf
# - echo "sync-uri = https://gitlab.com/APN-Pucky/gentoo-${REPO_NAME}.git" >> /etc/portage/repos.conf/${REPO_NAME}.conf
# - emaint -r ${REPO_NAME} sync
# - pushd /var/db/repos/${REPO_NAME} && git remote set-branches origin '*' && git fetch -v --depth=1 && git pull --unshallow && git checkout ${CI_COMMIT_SHA} && popd
# script:
# - pkgcheck ci -r ${REPO_NAME} --exit --quiet
# allow_failure: true
.check:
image: apnpucky/gentoo-ebuild-ci
extends: .config
stage: checksingle
before_script:
- emerge app-eselect/eselect-repository
- eselect repository enable science && emaint -r science sync
script:
- pkgcheck scan "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --exit
rules:
- if: $ARCH == "amd64"
.warn:
image: apnpucky/gentoo-ebuild-ci
extends: .config
stage: checksingle
before_script:
- emerge app-eselect/eselect-repository
- eselect repository enable science && emaint -r science sync
script:
- pkgcheck scan "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --exit warning || exit 137
allow_failure:
exit_codes: 137
rules:
- if: $ARCH == "amd64"
.build:
stage: build
extends: .configall
script:
- USE="-root" emerge "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --autounmask=y --autounmask-write --autounmask-continue --autounmask-use=y 2>&1 | tee "build_${CATEGORY}_${PKG}-${VERSION}_${ARCH}.log";
artifacts:
when: always
paths:
- "build_*.log"
expire_in: 1 week
.test:
stage: test
extends: .configall
script:
# if python_single in ebuild
- grep -q "python-single" ${CATEGORY}/${PKG}/${PKG}-${VERSION}*.ebuild && printf '\nPYTHON_SINGLE_TARGET=""\n' >> /etc/portage/make.conf
- grep -q "lua-single" ${CATEGORY}/${PKG}/${PKG}-${VERSION}*.ebuild && printf '\nLUA_SINGLE_TARGET=""\n' >> /etc/portage/make.conf
- if [[ -n $PROBABILITY ]] && [[ $(( RANDOM % 101 )) -gt $PROBABILITY ]] ; then exit 137 ; fi
- pkg-testing-tool -C --append-emerge "--autounmask=y --autounmask-write --autounmask-continue --autounmask-use=y" --max-use-combinations 32 --ccache --extra-env-file 'test.conf' --append-required-use "!root" --test-feature-scope always -p "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --report test_${CATEGORY}_${PKG}-${VERSION}_${ARCH}.json 2>&1 | tee "test_${CATEGORY}_${PKG}-${VERSION}_${ARCH}.log";
artifacts:
when: always
paths:
- "test_*.log"
- "test*.json"
expire_in: 1 week
allow_failure:
exit_codes: 137
.qa:
stage: qa
extends: .config
script:
- ls *.log
- (! grep -A10 -B10 "QA Notice" test_${CATEGORY}_${PKG}-${VERSION}*.log)
allow_failure: true
check:
extends: .check
warn:
extends: .warn
build:
needs: []
extends: .build
test:
needs: []
extends: .test
qa:
extends: .qa