forked from brendanhay/gogol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-matrix
executable file
·48 lines (36 loc) · 974 Bytes
/
travis-matrix
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
#!/usr/bin/env bash
set -e
docs=( documentation )
core=( gogol-core gogol )
examples=( gogol-examples )
priority_=( compute drive appengine storage oauth2 gmail )
priority=${priority_[@]/#/gogol-}
library_=( $(ls -d gogol-*) )
library=( $(echo ${library_[@]} ${priority[@]} | tr ' ' '\n' | sort | uniq -u) )
entry() {
local ver="$1"
local lib="$2"
cat <<-ENTRY
- env: GHCVER=${ver} LIBRARY=${lib}
addons: { apt: { packages: [ghc-${ver}], sources: [hvr-ghc] } }
ENTRY
}
matrix() {
local title="$1"
declare -a versions=("${!2}")
declare -a selected=("${!3}")
cat <<-TITLE
# ${title}
TITLE
for lib in ${selected[@]}; do
for ver in ${versions[@]}; do
entry $ver $lib
done
done
}
ghc_710=( 7.10.3 )
matrix "Documentation" ghc_710[@] docs[@]
matrix "Core" ghc_710[@] core[@]
matrix "Priority" ghc_710[@] priority[@]
matrix "Remainder" ghc_710[@] library[@]
matrix "Examples" ghc_710[@] examples[@]