-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml.mustache
100 lines (94 loc) · 3.59 KB
/
.travis.yml.mustache
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
# This file was generated from `meta.yml`, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
os: linux
dist: bionic
language: shell
.opam: &OPAM
language: shell
services: docker
install: |
# Prepare the COQ container
docker pull ${COQ_IMAGE}
docker run -d -i --init --name=COQ -v ${TRAVIS_BUILD_DIR}:/home/coq/${PACKAGE} -w /home/coq/${PACKAGE} ${COQ_IMAGE}
docker exec COQ /bin/bash --login -c "
# This bash script is double-quoted to interpolate Travis CI env vars:
echo \"Build triggered by ${TRAVIS_EVENT_TYPE}\"
export PS4='+ \e[33;1m(\$0 @ line \$LINENO) \$\e[0m '
set -ex # -e = exit on failure; -x = trace for debug
{{# ci_extra_dev }}
opam repo -a --set-default add coq-extra-dev https://coq.inria.fr/opam/extra-dev
{{/ ci_extra_dev }}
opam update -y
opam pin add ${PACKAGE} . -y -n -k path
opam install ${PACKAGE} -y -j ${NJOBS} --deps-only
opam config list
opam repo list
opam list
"
script:
- echo -e "${ANSI_YELLOW}Building ${PACKAGE}...${ANSI_RESET}" && echo -en 'travis_fold:start:script\\r'
- |
docker exec COQ /bin/bash --login -c "
export PS4='+ \e[33;1m(\$0 @ line \$LINENO) \$\e[0m '
set -ex
sudo chown -R coq:coq /home/coq/${PACKAGE}
opam install ${PACKAGE} -v -y -j ${NJOBS}
{{# ci_test_dependants }}
PINS=$(opam list -s --pinned --columns=package | xargs | tr ' ' ,)
PACKAGES=`opam list -s --depends-on {{ opam_name }}{{^ opam_name }}coq-{{ shortname }}{{/ opam_name }} --coinstallable-with $PINS`
if [ -n "$PACKAGES" ]
then opam install -t $PACKAGES
fi
{{/ ci_test_dependants }}
"
- docker stop COQ # optional
- echo -en 'travis_fold:end:script\\r'
{{# nix }}
.nix: &NIX
language: nix
nix: 2.3.7
install:
# for cachix we need travis to be a trusted nix user
- echo "trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf
- sudo systemctl restart nix-daemon
- nix-env -iA nixpkgs.cachix
{{# cachix }}
- cachix use {{ name }}
{{/ cachix }}{{^ cachix }} - cachix use coq
- cachix use coq-community
- cachix use math-comp
{{/ cachix }}
script: >
nix-build https://github.com/coq-community/coq-nix-toolbox/archive/master.tar.gz --argstr job {{ shortname }} --arg override "{ $VERSIONS; {{ shortname }} = builtins.filterSource (path: _: baseNameOf path != \".git\") ./.; }"
{{/ nix }}
jobs:
include:
{{# nix }}
# Test supported versions of Coq via Nix
{{# tested_coq_nix_versions }}
- env:
- VERSIONS='coq = "{{ coq_version }}"{{# extra_dev_dependencies }}; {{ nix_name }} = {{ dev_version }}{{^ dev_version }}"master"{{/ dev_version }}{{/ extra_dev_dependencies }}'
<<: *NIX
{{/ tested_coq_nix_versions }}{{^ tested_coq_nix_versions }} - env:
- VERSIONS='coq = "master"'
<<: *NIX
{{/ tested_coq_nix_versions }}
{{/ nix }}
# Test supported versions of Coq via OPAM
{{# tested_coq_opam_versions }}
- env:
- COQ_IMAGE={{ repo }}{{^ repo }}coqorg/coq{{/ repo }}:{{ version }}
- PACKAGE={{ opam_name }}{{^ opam_name }}coq-{{ shortname }}{{/ opam_name }}.{{ opam-file-version }}{{^ opam-file-version }}dev{{/ opam-file-version }}
- NJOBS=2
<<: *OPAM
{{/ tested_coq_opam_versions }}
{{# extracted }}
# Test extracted supported versions of Coq via OPAM
{{# extracted_tested_coq_opam_versions }}
- env:
- COQ_IMAGE=coqorg/coq:{{ version }}
- PACKAGE={{ extracted_shortname }}.{{ opam-file-version }}{{^ opam-file-version }}dev{{/ opam-file-version }}
- NJOBS=2
<<: *OPAM
{{/ extracted_tested_coq_opam_versions }}
{{/ extracted }}