on master help sign in
add travis-ci
66d3641Hugh JF Chen
.travis.yml+7−17
@@ -1,6 +1,8 @@
1# For more information, see https://github.com/ChrisPenner/haskell-stack-travis-ci
1# For more information, see https://github.com/ChrisPenner/haskell-stack-travis-ci
2language: c
2language: c
3−sudo: false
3+sudo: true
4+
5+dist: bionic
4
6
5git:
7git:
6 submodules: false # whether to recursively clone submodules
8 submodules: false # whether to recursively clone submodules
@@ -37,28 +39,16 @@ matrix:
37
39
38before_script:
40before_script:
39 - unset CC
41 - unset CC
40− - export PATH=$HOME/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH
42+ - sudo apt-get update
41− - ./.travis/install-ghr.sh
43+ - sudo apt-get -y upgrade
42− - ./.travis/install-stack.sh
44+ - sudo apt-get -y install git curl
43
45
44# Here starts the actual work to be performed for the package under test;
46# Here starts the actual work to be performed for the package under test;
45# any command which exits with a non-zero exit code causes the build to fail.
47# any command which exits with a non-zero exit code causes the build to fail.
46script:
48script:
47 - |
49 - |
48 # Run tests
50 # Run tests
49− set -e
51+ ./ci/DevOps/local/test/cb.sh
50− ./.travis/install-dependencies.sh
51− stack --no-terminal --jobs=2 --system-ghc test
52− - |
53− #Run HLint
54− if [[ "$(uname)" = "Linux" ]]; then
55− curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s lint src test examples --cpp-define VERSION_project_m36=HLINT
56− fi
57− - |
58− #Run Haddock
59− if [[ "$(uname)" = "Linux" ]]; then
60− stack --no-install-ghc --system-ghc --no-haddock-deps haddock
61− fi
62
52
63after_success:
53after_success:
64 - |
54 - |
.travis.yml.orignew file+68
@@ -0,0 +1,68 @@
1+# For more information, see https://github.com/ChrisPenner/haskell-stack-travis-ci
2+language: c
3+sudo: false
4+
5+git:
6+ submodules: false # whether to recursively clone submodules
7+
8+cache:
9+ directories:
10+ - $HOME/.ghc
11+ - $HOME/.cabal
12+ - $HOME/.stack
13+ - .stack-work
14+ timeout: 1000
15+
16+matrix:
17+ fast_finish: true
18+ include:
19+ - env: CACHE_NAME=8.2.2 STACK_YAML=stack.ghc8.2.yaml
20+ compiler: ": #stack 8.2.2"
21+
22+ - env: CACHE_NAME=osx-8.2.2 STACK_YAML=stack.ghc8.2.yaml
23+ os: osx
24+ osx_image: xcode7.3
25+ compiler: ": #stack 8.2.2"
26+
27+ - env: CACHE_NAME=8.4.4 STACK_YAML=stack.ghc8.4.yaml
28+ compiler: ": #stack 8.4.4"
29+
30+ - env: CACHE_NAME=8.6.5 STACK_YAML=stack.ghc8.6.yaml
31+ compiler: ": #stack 8.6.5"
32+
33+ - env: CACHE_NAME=osx-8.6.5 STACK_YAML=stack.ghc8.6.yaml
34+ os: osx
35+ osx_image: xcode11
36+ compiler: ": #stack 8.6.5"
37+
38+before_script:
39+ - unset CC
40+ - export PATH=$HOME/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH
41+ - ./.travis/install-ghr.sh
42+ - ./.travis/install-stack.sh
43+
44+# Here starts the actual work to be performed for the package under test;
45+# any command which exits with a non-zero exit code causes the build to fail.
46+script:
47+ - |
48+ # Run tests
49+ set -e
50+ ./.travis/install-dependencies.sh
51+ stack --no-terminal --jobs=2 --system-ghc test
52+ - |
53+ #Run HLint
54+ if [[ "$(uname)" = "Linux" ]]; then
55+ curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s lint src test examples --cpp-define VERSION_project_m36=HLINT
56+ fi
57+ - |
58+ #Run Haddock
59+ if [[ "$(uname)" = "Linux" ]]; then
60+ stack --no-install-ghc --system-ghc --no-haddock-deps haddock
61+ fi
62+
63+after_success:
64+ - |
65+ # Build and ship binary
66+ #./.travis/attach-binary.sh
67+
68+# EOF
DevOps/local/test/build/prepare.sh+10−1
@@ -14,7 +14,7 @@ begin_banner "Top level" "build prepare"
14get_last_stable_nix_channel () {
14get_last_stable_nix_channel () {
15 local MY_CHANNEL_NAME_REGEX=""
15 local MY_CHANNEL_NAME_REGEX=""
16 case ${THE_DISTRIBUTION_ID} in
16 case ${THE_DISTRIBUTION_ID} in
17− debian|rhel|centos) MY_CHANNEL_NAME_REGEX='s/.*\(nixos-[0-9][0-9].[0-9][0-9]\).*/\1/p' ;;
17+ debian|ubuntu|rhel|centos) MY_CHANNEL_NAME_REGEX='s/.*\(nixos-[0-9][0-9].[0-9][0-9]\).*/\1/p' ;;
18 Darwin) MY_CHANNEL_NAME_REGEX='s/.*\(nixpkgs-[0-9][0-9].[0-9][0-9]-darwin\).*/\1/p' ;;
18 Darwin) MY_CHANNEL_NAME_REGEX='s/.*\(nixpkgs-[0-9][0-9].[0-9][0-9]-darwin\).*/\1/p' ;;
19 *) ;;
19 *) ;;
20 esac
20 esac
@@ -39,6 +39,10 @@ if ! type nix-build >/dev/null 2>&1; then
39 [[ -e /proc/sys/kernel/unprivileged_userns_clone ]] && sudo sysctl kernel.unprivileged_userns_clone=1
39 [[ -e /proc/sys/kernel/unprivileged_userns_clone ]] && sudo sysctl kernel.unprivileged_userns_clone=1
40 curl https://nixos.org/nix/install | sh
40 curl https://nixos.org/nix/install | sh
41 ;;
41 ;;
42+ ubuntu)
43+ [[ -e /proc/sys/kernel/unprivileged_userns_clone ]] && sudo sysctl kernel.unprivileged_userns_clone=1
44+ curl https://nixos.org/nix/install | sh
45+ ;;
42 Darwin)
46 Darwin)
43 curl https://nixos.org/nix/install | sh
47 curl https://nixos.org/nix/install | sh
44 ;;
48 ;;
@@ -82,6 +86,11 @@ if ! type nodejs >/dev/null 2>&1 && ! type node >/dev/null 2>&1; then
82 sudo apt-get update
86 sudo apt-get update
83 sudo apt-get install -y nodejs
87 sudo apt-get install -y nodejs
84 ;;
88 ;;
89+ ubuntu)
90+ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
91+ sudo apt-get update
92+ sudo apt-get install -y nodejs
93+ ;;
85 Darwin)
94 Darwin)
86 if type brew > /dev/null 2>&1; then
95 if type brew > /dev/null 2>&1; then
87 brew install node@10
96 brew install node@10
DevOps/local/test/build/unprepare.sh+2−2
@@ -17,7 +17,7 @@ set -u
17
17
18if type nix-build >/dev/null 2>&1; then
18if type nix-build >/dev/null 2>&1; then
19 info "nix-build found, trying to uninstall it"
19 info "nix-build found, trying to uninstall it"
20− if [ "${THE_DISTRIBUTION_ID}" == "debian" ]; then
20+ if [ "${THE_DISTRIBUTION_ID}" == "debian" ] || [ "${THE_DISTRIBUTION_ID}" == "ubuntu" ]; then
21 [[ -e /proc/sys/kernel/unprivileged_userns_clone ]] && sudo sysctl kernel.unprivileged_userns_clone=1
21 [[ -e /proc/sys/kernel/unprivileged_userns_clone ]] && sudo sysctl kernel.unprivileged_userns_clone=1
22 fi
22 fi
23 set +e
23 set +e
@@ -34,7 +34,7 @@ fi
34if type nodejs >/dev/null 2>&1 || type node >/dev/null 2>&1; then
34if type nodejs >/dev/null 2>&1 || type node >/dev/null 2>&1; then
35 info "nodejs found, trying to uninstall it"
35 info "nodejs found, trying to uninstall it"
36 case ${THE_DISTRIBUTION_ID} in
36 case ${THE_DISTRIBUTION_ID} in
37− debian)
37+ debian|ubuntu)
38 sudo apt-get purge -y nodejs
38 sudo apt-get purge -y nodejs
39 ;;
39 ;;
40 Darwin)
40 Darwin)
DevOps/local/test/deploy/prepare.sh+28−1
@@ -42,6 +42,33 @@ if ! type docker >/dev/null 2>&1; then
42 sudo apt-get install -y docker-ce docker-ce-cli containerd.io
42 sudo apt-get install -y docker-ce docker-ce-cli containerd.io
43 sudo /usr/sbin/usermod -a -G docker $(whoami)
43 sudo /usr/sbin/usermod -a -G docker $(whoami)
44 ;;
44 ;;
45+ ubuntu) THE_DISTRIBUTION_VERSION_CODENAME=$(grep -w "VERSION_CODENAME" /etc/os-release |awk -F"=" '{print $NF}'|sed 's/"//g')
46+ my_arch=$(uname -m)
47+ if [ ${my_arch} = "aarch64" ]; then
48+ docker_arm="arm64"
49+ else
50+ docker_arm="amd64"
51+ fi
52+ if dpkg-query -l | grep docker.io ; then
53+ sudo apt-get purge -y docker.io
54+ fi
55+ if dpkg-query -l | grep docker-engine ; then
56+ sudo apt-get purge -y docker-engine
57+ fi
58+ if dpkg-query -l | grep docker ; then
59+ sudo apt-get purge -y docker
60+ fi
61+ if dpkg-query -l | grep runc ; then
62+ sudo apt-get purge -y runc
63+ fi
64+ sudo apt-get update
65+ sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
66+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
67+ sudo add-apt-repository "deb [arch=${docker_arm}] https://download.docker.com/linux/ubuntu ${THE_DISTRIBUTION_VERSION_CODENAME} stable"
68+ sudo apt-get update
69+ sudo apt-get install -y docker-ce docker-ce-cli containerd.io
70+ sudo /usr/sbin/usermod -a -G docker $(whoami)
71+ ;;
45 centos) sudo yum install -y yum-utils device-mapper-persistent-data lvm2
72 centos) sudo yum install -y yum-utils device-mapper-persistent-data lvm2
46 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
73 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
47 sudo yum install -y docker-ce docker-ce-cli containerd.io
74 sudo yum install -y docker-ce docker-ce-cli containerd.io
@@ -68,7 +95,7 @@ if ! type docker-compose >/dev/null 2>&1; then
68 case ${THE_DISTRIBUTION_ID} in
95 case ${THE_DISTRIBUTION_ID} in
69 rhel) my_exit "docker-compose depends on docker, yet don't know how to install docker-ce on RHEL, so abord." 1
96 rhel) my_exit "docker-compose depends on docker, yet don't know how to install docker-ce on RHEL, so abord." 1
70 ;;
97 ;;
71− debian) sudo apt-get update
98+ debian|ubuntu) sudo apt-get update
72 sudo apt-get install -y docker-compose
99 sudo apt-get install -y docker-compose
73 ;;
100 ;;
74 centos) sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
101 centos) sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
DevOps/local/test/deploy/unprepare.sh+2−2
@@ -16,7 +16,7 @@ if type docker >/dev/null 2>&1; then
16 case ${THE_DISTRIBUTION_ID} in
16 case ${THE_DISTRIBUTION_ID} in
17 rhel) info "This script not know how to install docker-ce on RHEL, so that docker cna't be installed by this script. Ignore."
17 rhel) info "This script not know how to install docker-ce on RHEL, so that docker cna't be installed by this script. Ignore."
18 ;;
18 ;;
19− debian) my_arch=$(uname -m)
19+ debian|ubuntu) my_arch=$(uname -m)
20 if [ ${my_arch} = "aarch64" ]; then
20 if [ ${my_arch} = "aarch64" ]; then
21 docker_arm="arm64"
21 docker_arm="arm64"
22 else
22 else
@@ -44,7 +44,7 @@ if type docker-compose >/dev/null 2>&1; then
44 case ${THE_DISTRIBUTION_ID} in
44 case ${THE_DISTRIBUTION_ID} in
45 rhel) info "This script not know how to install docker-compose on RHEL, so that docker-compose cna't be installed by this script. Ignore."
45 rhel) info "This script not know how to install docker-compose on RHEL, so that docker-compose cna't be installed by this script. Ignore."
46 ;;
46 ;;
47− debian) sudo apt-get purge -y docker-compose
47+ debian|ubuntu) sudo apt-get purge -y docker-compose
48 ;;
48 ;;
49 centos) [[ -e /usr/local/bin/docker-compose ]] && sudo rm /usr/local/bin/docker-compose
49 centos) [[ -e /usr/local/bin/docker-compose ]] && sudo rm /usr/local/bin/docker-compose
50 [[ -L /usr/bin/docker-compose ]] && sudo rm /usr/bin/docker-compose
50 [[ -L /usr/bin/docker-compose ]] && sudo rm /usr/bin/docker-compose
DevOps/local/test/finishing.sh+4
@@ -19,6 +19,10 @@ case ${THE_DISTRIBUTION_ID} in
19 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
19 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
20 fi
20 fi
21 ;;
21 ;;
22+ ubuntu) if [ "${THE_DISTRIBUTION_VERSION}" != "16.04" ] && [ "${THE_DISTRIBUTION_VERSION}" != "18.04" ]; then
23+ my_exit "This CI/CD script only supports ubuntu 16.04 and 18.04, will abort" 1
24+ fi
25+ ;;
22 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
26 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
23 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
27 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
24 fi
28 fi
DevOps/local/test/prepare.sh+4
@@ -20,6 +20,10 @@ case ${THE_DISTRIBUTION_ID} in
20 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
20 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
21 fi
21 fi
22 ;;
22 ;;
23+ ubuntu) if [ "${THE_DISTRIBUTION_VERSION}" != "16.04" ] && [ "${THE_DISTRIBUTION_VERSION}" != "18.04" ]; then
24+ my_exit "This CI/CD script only supports ubuntu 16.04 and 18.04, will abort" 1
25+ fi
26+ ;;
23 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
27 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
24 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
28 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
25 fi
29 fi
DevOps/local/test/unfinishing.sh+4
@@ -20,6 +20,10 @@ case ${THE_DISTRIBUTION_ID} in
20 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
20 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
21 fi
21 fi
22 ;;
22 ;;
23+ ubuntu) if [ "${THE_DISTRIBUTION_VERSION}" != "16.04" ] && [ "${THE_DISTRIBUTION_VERSION}" != "18.04" ]; then
24+ my_exit "This CI/CD script only supports ubuntu 16.04 and 18.04, will abort" 1
25+ fi
26+ ;;
23 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
27 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
24 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
28 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
25 fi
29 fi
DevOps/local/test/unprepare.sh+4
@@ -19,6 +19,10 @@ case ${THE_DISTRIBUTION_ID} in
19 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
19 my_exit "This CI/CD script only supports debian 9.x and 10.x, will abort" 1
20 fi
20 fi
21 ;;
21 ;;
22+ ubuntu) if [ "${THE_DISTRIBUTION_VERSION}" != "16.04" ] && [ "${THE_DISTRIBUTION_VERSION}" != "18.04" ]; then
23+ my_exit "This CI/CD script only supports ubuntu 16.04 and 18.04, will abort" 1
24+ fi
25+ ;;
22 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
26 centos) if [ "${THE_DISTRIBUTION_VERSION}" != "7" ]; then
23 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
27 my_exit "This CI/CD script only support Centos 7.x, will abort" 1
24 fi
28 fi