forked from coq/opam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
96 lines (87 loc) · 2.79 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
stages:
- lint
- build
image: buildpack-deps:stable-scm
variables:
OPAMJOBS: "2"
cache:
paths:
- opam-cache
key: v2
before_script:
- export HOME=$(pwd)
- echo CI_RUNNER_TAGS=${CI_RUNNER_TAGS}
- export OPAM_VARIANT=$(if echo $CI_RUNNER_TAGS | grep -q no-sandbox; then echo "plain"; else echo "sandbox"; fi)
- echo OPAM_VARIANT=${OPAM_VARIANT}
- export OPAM_VERSION=2.1.2
- export OPAM_ROOT_DIR=${HOME}/opam-root-${COMPILER}-${OPAM_VERSION}-${OPAM_VARIANT}
- export OPAM_ROOT_CACHE=${HOME}/opam-cache/cache-${COMPILER}-${OPAM_VERSION}-${OPAM_VARIANT}.tgz
- apt-get update -qy
- apt-get install build-essential -y # missing with Debian bullseye
- apt-get install unzip libgtksourceview-3.0-dev libncurses5-dev curl jq ruby bubblewrap time libgmp-dev coinor-csdp libstring-shellquote-perl libipc-system-simple-perl automake autoconf libtool wdiff -y # wdiff is used in test-suite of hierarchy-builder
- apt-get install clang -y
- test -e $OPAM_ROOT_CACHE || scripts/opam-coq-init
- curl -L https://github.com/ocaml/opam/releases/download/${OPAM_VERSION}/opam-${OPAM_VERSION}-x86_64-linux >/usr/local/bin/opam
- chmod +x /usr/local/bin/opam
- set -o pipefail
.opam-build:
stage: build
tags:
- ci.inria.fr
- medium
script: |
PR=${CI_COMMIT_REF_NAME##pr-};
echo "Github PR number: $PR";
SKIP=$(set +o pipefail; curl https://api.github.com/repos/coq/opam/issues/$PR | jq -rc .body | grep ^ci-skip: | cat );
echo "SKIP packages per user request: $SKIP";
scripts/opam-coq-list-pr-files | xargs scripts/opam-coq-install-remove $OPAM_ROOT_CACHE $SKIP --
artifacts:
name: "$CI_JOB_NAME"
when: on_failure
paths:
- log/
expire_in: 1 week
# Json
json-data:
stage: build
tags:
- ci.inria.fr
- medium
variables:
COMPILER: "4.11.2"
script: |
. scripts/opam-coq-setup-root
mkdir -p log; > log/log.json
setup_root $OPAM_ROOT_CACHE log/log.json
opam install -y dune.2.9.3 opam-core.2.1.0 opam-file-format.2.1.3 ppx_deriving_yojson.3.6.1
ocamlfind opt -package opam-file-format,opam-core,ppx_deriving_yojson,str -linkpkg scripts/archive2web.ml -o scripts/archive2web
scripts/archive2web released extra-dev > coq-packages.json
artifacts:
name: "$CI_JOB_NAME"
paths:
- coq-packages.json
expire_in: 1 week
# Lint
opam-lint:
stage: lint
tags:
- ci.inria.fr
- medium
variables:
COMPILER: "4.11.2"
script:
- scripts/opam-coq-list-pr-files | xargs scripts/opam-coq-lint
# Build
opam-build:4.14.2:
extends: .opam-build
variables:
COMPILER: "4.14.2"
except:
- web
opam-build:4.14.2:minimal:
extends: .opam-build
variables:
COMPILER: "4.14.2"
EXTRA_OPAM_OPTION: "--criteria=-count(removed),-count(down),-count(changed),+sum(changed,version-lag)"
except:
- web