#!/usr/bin/env bash fail () { echo "$@" if [ "$TRAVIS_PULL_REQUEST" = false ] then exit 1 else exit 0 fi } cache=1 if [ -z "$CACHIX_SIGNING_KEY" ] then echo "The CACHIX_SIGNING_KEY environment variable needs to be set." echo "Disabling cachix uploads" cache=0 fi if [ -z "$CACHIX_AUTH_TOKEN" ] then echo "The CACHIX_AUTH_TOKEN environment variable needs to be set." echo "Disabling cachix uploads" cache=0 fi cleanup () { rm -f .cache.list } trap cleanup EXIT set -ex if [ $cache = 1 ] then cachix authtoken "$CACHIX_AUTH_TOKEN" >/dev/null fi cachix use urbit2 || true build () { nix-build --no-out-link --max-jobs 3 "$@" > .cache.list if [ $cache = 1 ] then cachix push urbit2 < .cache.list fi } time build nix/cachix/local.nix #time build nix/cachix/tests.nix -A fakebus time build nix/cachix/tests.nix -A results time build nix/cachix/release.nix