Skip to content

Commit

Permalink
test: rework the travis test configuration ♻️
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrieanKhisbe committed Apr 11, 2020
1 parent 97d5ffa commit 944d93f
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 30 deletions.
54 changes: 25 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
language: generic
language: sh
# adapted from https://github.com/mafredri/zsh-async

# based from https://github.com/mafredri/zsh-async
addons:
apt:
packages:
- build-essential
- tree
- yodl
- zsh

env:
global:
- ZSH_DIST=$HOME/.zsh-dist
matrix:
- ZVM_VERSION=5.4.2
- ZVM_VERSION=5.3.1
- ZVM_VERSION=5.3
- ZVM_VERSION=5.2
- ZVM_VERSION=5.1.1
- ZVM_VERSION=5.0.8
- ZVM_VERSION=5.0.2
- ZVM_VERSION=4.3.17
- ZVM_VERSION=4.3.12
# Use _ZSH_VERSION since if ZSH_VERSION is present, travis cacher thinks it
# is running in zsh and tries to use zsh specific functions.
- _ZSH_VERSION=5.6.2
- _ZSH_VERSION=5.5.1
- _ZSH_VERSION=5.4.2
- _ZSH_VERSION=5.3.1
- _ZSH_VERSION=5.3
- _ZSH_VERSION=5.2
- _ZSH_VERSION=5.1.1
- _ZSH_VERSION=5.0.8
- _ZSH_VERSION=5.0.2

cache:
apt: true
directories:
- $HOME/.zvm
- $ZSH_DIST

before_install:
- if [[ $(ls "$HOME/.zvm" | wc -l) -eq 0 ]]; then rm -rf "$HOME/.zvm"; fi # hack for caching init
- curl -L https://zulu.molovo.co/install | zsh
- export SHELL=zsh
- zsh -c "source ~/.zshrc; zulu install zvm && zvm use $ZVM_VERSION"
- scripts/travis-setup-zsh $_ZSH_VERSION
- zsh --version

install:
# install antigen
- curl -L git.io/antigen > ~/antigen.zsh
- cat .travis-zshrc > ~/.zshrc ; cat ~/.zshrc
- curl -L git.io/antigen > ~/antigen.zsh # install antigen
- cat scripts/travis-zshrc > ~/.zshrc ; cat ~/.zshrc
- echo "setopt sh_word_split" >> ~/.zshenv
- which zsh
- export ZSH=$HOME/.zvm/bin/zsh
#- $ZSH ~/.zshrc

script:
- $ZSH --version
- $ZSH .travis-run.zsh
- zsh scripts/travis-run.zsh

notifications:
email: false
allow_failures:
- env: _ZSH_VERSION=5.0.2
- env: _ZSH_VERSION=5.0.8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Zsh Diractions
*Doing Anything, Anywhere, from here*

[![Tag Version](https://img.shields.io/github/tag/AdrieanKhisbe/diractions.svg)](https://github.com/AdrieanKhisbe/diractions/tags)
[![Build Status](https://travis-ci.org/AdrieanKhisbe/diractions.svg)](https://travis-ci.org/AdrieanKhisbe/diractions)
[![Build Status](https://travis-ci.com/AdrieanKhisbe/diractions.svg)](https://travis-ci.com/AdrieanKhisbe/diractions)
[![Join the chat https://gitter.im/AdrieanKhisbe/diractions](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AdrieanKhisbe/diractions)


Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions scripts/travis-setup-zsh.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env zsh
# to be sourced from travis.
# adpated from https://github.com/mafredri/zsh-async/blob/master/.travis.yml
setup_zsh() {
dest="$ZSH_DIST/$1"
tar_type=.tar.xz
tar_args=xJ
case $1 in
5.0.8|5.0.2) tar_type=.tar.gz; tar_args=xz;;
esac
if [[ ! -d $dest/bin ]]; then
tmp="$(mktemp --directory --tmpdir="${TMPDIR:/tmp}" zshbuild.XXXXXX)"
(
cd "$tmp" &&
curl -L http://downloads.sourceforge.net/zsh/zsh-${1}${tar_type} | tar ${tar_args} &&
cd zsh-$1 &&
./configure --prefix="$dest" &&
make &&
mkdir -p "$dest" &&
make install ||
echo "Failed to build zsh-${1}!"
)
fi
export PATH="$dest/bin:$PATH"
}

setup_zsh $@
File renamed without changes.
1 change: 1 addition & 0 deletions test/diraction_dispatcher_completion_shpec.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

setopt aliases
ORIGINAL_DIR="$PWD"
source $(dirname $0:A)/../diractions.plugin.zsh
_DISPATCHER=$(dirname $0:A)/../__diraction-dispatch
function __diraction-dispatch() {
. $_DISPATCHER
Expand Down

0 comments on commit 944d93f

Please sign in to comment.