travis: split up scripts into statements

Advantages:
- The build fails if a statement fails.
  Previously, errors in all but the last statement were silently
  ignored.
- The Travis log gives a fine-grained view of the output of each
  statement.

Add if statements because the '[…] &&' prefix results in YAML syntax
errors.
This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:48 +01:00
parent 10d6b04ac8
commit 190a92507c
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -3,19 +3,19 @@ language: minimal
# broken: # broken:
# - PKG=electrs STABLE=0 # - PKG=electrs STABLE=0
# Retry installing nix due to nondeterministic error install:
# Fatal error: glibc detected an invalid stdio handle # Retry installing nix due to nondeterministic error
# see: # Fatal error: glibc detected an invalid stdio handle
# https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181 # see:
# https://github.com/nixos/nix/issues/2733 # https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181
install: | # https://github.com/nixos/nix/issues/2733
(for i in {1..5}; do bash <(curl https://nixos.org/nix/install) && exit 0; done; exit 1) - (for i in {1..5}; do bash <(curl https://nixos.org/nix/install) && exit 0; done; exit 1)
. /home/travis/.nix-profile/etc/profile.d/nix.sh - . /home/travis/.nix-profile/etc/profile.d/nix.sh
nix-env -iA cachix -f https://cachix.org/api/v1/install - nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use nix-bitcoin - cachix use nix-bitcoin
[ $STABLE -eq 1 ] && export NIX_PATH="nixpkgs=$(nix eval --raw -f pkgs/nixpkgs-pinned.nix nixpkgs)" - if [[ $STABLE == 1 ]]; then export NIX_PATH="nixpkgs=$(nix eval --raw -f pkgs/nixpkgs-pinned.nix nixpkgs)"; fi
[ $STABLE -eq 0 ] && export NIX_PATH="nixpkgs=$(nix eval --raw -f pkgs/nixpkgs-pinned.nix nixpkgs-unstable)" - if [[ $STABLE == 0 ]]; then export NIX_PATH="nixpkgs=$(nix eval --raw -f pkgs/nixpkgs-pinned.nix nixpkgs-unstable)"; fi
VER="$(nix eval nixpkgs.lib.version)" - VER="$(nix eval nixpkgs.lib.version)"
env: env:
matrix: matrix:
- PKG=nodeinfo STABLE=1 - PKG=nodeinfo STABLE=1
@ -29,6 +29,6 @@ env:
- PKG=elementsd STABLE=0 - PKG=elementsd STABLE=0
- PKG=electrs STABLE=1 - PKG=electrs STABLE=1
- PKG=liquid-swap STABLE=1 - PKG=liquid-swap STABLE=1
script: | script:
printf '%s (%s)\n' "$NIX_PATH" "$VER" - printf '%s (%s)\n' "$NIX_PATH" "$VER"
nix-build -A $PKG - nix-build -A $PKG