-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
133 lines (124 loc) · 3.65 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
stages:
- build
- test
- package
build:
stage: build
image: jojoboulix/amc-build
script:
- make version_files
- make
artifacts:
untracked: true
public: false
expire_in: 4 days
tests:
stage: test
needs:
- job: build
artifacts: true
image: jojoboulix/amc-build
script:
- make install && texhash
- make -C tests blind-test
test-uninstall:
stage: test
needs:
- job: pack-sources
artifacts: true
image: jojoboulix/amc-build
script:
- mkdir files
- touch files/f-before files/d-before files/f-after files/d-after
- mkdir u
- cd u
- "tar xvzf ../artifacts/auto-multiple-choice_*_dist.tar.gz"
- cd auto-multiple-choice-*
- make
- find / -path /proc -prune -o -type f | sort > ../../files/f-before ; find / -path /proc -prune -o -type d | sort > ../../files/d-before
- make install
- make uninstall
- cd ../..
- find / -path /proc -prune -o -type f | sort > files/f-after ; find / -path /proc -prune -o -type d | sort > files/d-after
- cd files
- diff d-before d-after || true
- diff f-before f-after
artifacts:
paths:
- files/
doc-xml:
stage: test
needs: []
image: debian:testing-slim
before_script:
- apt-get update
- apt-get install -y make libxml2-utils docbook-xml
script:
- make -C doc check
pack-sources:
stage: build
image: jojoboulix/amc-build
script:
- make sources
- mkdir artifacts
- "mv tarballs/auto-multiple-choice_*_dist.tar.gz artifacts"
- "mv tarballs/auto-multiple-choice_*_sources.tar.gz artifacts"
artifacts:
paths:
- artifacts/
pack-portable:
stage: build
image: jojoboulix/amc-build
script:
- make portable
- mkdir artifacts
- "mv tarballs/auto-multiple-choice_*_portable.tar.gz artifacts"
artifacts:
paths:
- artifacts/
test-portable:
stage: test
needs:
- job: pack-portable
artifacts: true
image: jojoboulix/amc-build
script:
- pwd
- mkdir portable
- cd portable
- "tar xvzf ../artifacts/auto-multiple-choice_*_portable.tar.gz"
- cd ../tests/gui/dogtail
- AMC_PATH=$CI_PROJECT_DIR/portable/AMC/bin/auto-multiple-choice ./blind-tests.sh simple
allow_failure: true
pack-debian:
stage: package
needs:
- job: pack-sources
artifacts: true
image: debian:testing-slim
before_script:
- perl ./local/deb822toplain.pl >> /etc/apt/sources.list
- apt-get update
- apt-get install -y git git-buildpackage
script:
- mkdir debian-package
- cd debian-package
- gbp clone https://salsa.debian.org/georgesk/auto-multiple-choice.git
- mk-build-deps -i -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" auto-multiple-choice/debian/control
- cd auto-multiple-choice
- git config user.name AMC
- git config user.email "paamc@passoire.fr"
- "export GBP_V=`grep auto-multiple-choice debian/changelog | head -n 1 | sed 's:.*(::; s:-[0-9]\\+).*$::'`"
- 'export GBP_DATE=`echo "$CI_COMMIT_TIMESTAMP" | head -c 16 | sed "s/[^0-9]//g"`'
- 'export GBP_UPSTREAM="$GBP_V+git$GBP_DATE"'
- 'gbp import-orig --upstream-version=$GBP_UPSTREAM --import-msg "New upstream version from git @$CI_COMMIT_SHORT_SHA" ../../artifacts/*_sources.tar.gz'
- perl -i -ne 'print if(/conf/)' debian/patches/series
- git diff --quiet -- debian/patches || git commit debian/patches/series -m "Skip patches, except for Makefile.conf"
- gbp dch -N "$GBP_UPSTREAM-1" --git-author --commit
- gbp buildpackage
artifacts:
paths:
- "debian-package/auto-multiple-choice*_*"
exclude:
- "debian-package/auto-multiple-choice-build-deps*"
allow_failure: true