forked from brendanhay/amazonka
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravis-matrix
More file actions
executable file
·51 lines (39 loc) · 1.03 KB
/
travis-matrix
File metadata and controls
executable file
·51 lines (39 loc) · 1.03 KB
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
#!/usr/bin/env bash
set -e
docs=( documentation )
core=( amazonka-core amazonka )
test=( amazonka-test )
examples=( amazonka-examples )
priority_=( s3 autoscaling elb sqs iam ec2 )
priority=${priority_[@]/#/amazonka-}
library_=( $(ls -d amazonka-*) )
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.2 )
ghc_all=( 7.10.2 7.8.4 )
matrix "Documentation" ghc_710[@] docs[@]
matrix "Core" ghc_all[@] core[@]
matrix "Test" ghc_710[@] test[@]
matrix "Priority" ghc_all[@] priority[@]
matrix "Remainder" ghc_710[@] library[@]
matrix "Examples" ghc_710[@] examples[@]