on ce42607 help sign in
gogol/script/travis-matrix
48 lines 974 B history raw
1#!/usr/bin/env bash
3set -e
5docs=( documentation )
6core=( gogol-core gogol )
7examples=( gogol-examples )
9priority_=( compute drive appengine storage oauth2 gmail )
10priority=${priority_[@]/#/gogol-}
12library_=( $(ls -d gogol-*) )
13library=( $(echo ${library_[@]} ${priority[@]} | tr ' ' '\n' | sort | uniq -u) )
15entry() {
16 local ver="$1"
17 local lib="$2"
19cat <<-ENTRY
20 - env: GHCVER=${ver} LIBRARY=${lib}
21 addons: { apt: { packages: [ghc-${ver}], sources: [hvr-ghc] } }
22ENTRY
25matrix() {
26 local title="$1"
27 declare -a versions=("${!2}")
28 declare -a selected=("${!3}")
30cat <<-TITLE
32 # ${title}
33TITLE
35 for lib in ${selected[@]}; do
36 for ver in ${versions[@]}; do
37 entry $ver $lib
38 done
39 done
42ghc_710=( 7.10.3 )
44matrix "Documentation" ghc_710[@] docs[@]
45matrix "Core" ghc_710[@] core[@]
46matrix "Priority" ghc_710[@] priority[@]
47matrix "Remainder" ghc_710[@] library[@]
48matrix "Examples" ghc_710[@] examples[@]