2020-05-27 16:12:53 +02:00
# 2020-05-26: NOTE: Enabling experimental Travis feature of YAML check inside
# Look into: Build #NUM -> Job #NUM.N -> View config -> Build config validation
version : ~> 1.0
2020-05-28 16:19:09 +02:00
# NOTE: Please, be aware that Travis YAML & docs & API are hard to make work properly. Travis configuration requires a lot of retries and some compromises. There are many ways that may look like that can be done in that way, but it would not work most of the time, or not work the way that you expect/need it. Travis config works only in certain particular ways. Some things look possible - but they are impossible in Travis. Current configuration is "the best way possible" that was found in ~100-150-200 retries, depending on what one considers a retry.
2020-05-27 16:13:25 +02:00
2020-05-27 16:13:45 +02:00
# NOTE: Let the official Travis YAML checker help you: https://config.travis-ci.com/explore
2018-05-06 20:59:31 +02:00
2018-08-04 03:24:21 +02:00
language : nix
2018-05-06 20:59:31 +02:00
2020-06-23 19:14:49 +02:00
sudo: required # 2020-05-26 : This mode is deprecated, but still offers 7.5 GB RAM instead of the default 4GB
2018-05-06 20:59:31 +02:00
2018-05-07 21:06:15 +02:00
git :
2020-06-23 19:14:49 +02:00
quiet : true # Do not log
2019-07-26 18:42:13 +02:00
depth: 4 # NOTE : "The use of clone depth: 1 often results in a git error
# when a new commit has been pushed to a branch before the CI
# platform started cloning the intended commit."
2018-05-07 21:06:15 +02:00
2020-06-23 19:14:49 +02:00
# # 2020-05-26: Currently newest macOS image
# osx_image: xcode11.4 # Official Nix installer fails spectacularly on it.
2020-05-27 16:15:46 +02:00
2017-12-29 04:42:24 +01:00
env :
2018-05-07 04:55:23 +02:00
global :
2020-06-23 19:44:11 +02:00
# NOTE: This is secure CACHIX_SIGNING_KEY=val, it is only available on project internal branches, so Cachix would push only there
2018-08-05 22:12:11 +02:00
- secure : "dm6I+M4+V+C7QMTpcSADdKPE633SvmToXZrTbZ7miNDGmMN+/SfHeN2ybi1+PW6oViMlbPN/7J/aEfiGjSJI8vLk72Y4uCWGmpSb8TXZLu6+whnxtZzzW8+z4tsM4048QJg7CF3N/25U8thRFgs3DqUub1Sf3nG9LrNWdz6ZcDQ="
2020-06-23 17:41:56 +02:00
###
### NOTE: This configuration uses `build.sh` interface, which uses `default.nix` interface, which exposes the Nixpkgs Haskell Lib interface.
###
2020-06-23 19:35:43 +02:00
### Documentation of this settings is mosly in `default.nix`, since most settings it Nixpkgs related
### and the other part of keys explained in `build.sh`, since those address external procedures aound the builds.
### Additional documentation is in Nixpkgs Haskell.lib: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib.nix
2020-06-23 17:41:56 +02:00
###
#
2020-05-27 16:18:48 +02:00
# - rev=nixos-unstable
# - NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"
2020-06-23 18:09:01 +02:00
- project='hnix'
2020-06-23 19:29:13 +02:00
- allowInconsistentDependencies='false'
2020-06-20 22:58:59 +02:00
- doJailbreak='false'
- doCheck='true'
2020-06-23 19:29:13 +02:00
- sdistTarball='false'
2020-06-20 22:58:59 +02:00
- buildFromSdist='false'
- buildStrictly='false'
2020-06-23 19:29:13 +02:00
- failOnAllWarnings='false'
- enableDeadCodeElimination='false'
2020-06-20 22:58:59 +02:00
- disableOptimization='true'
2020-06-23 19:29:13 +02:00
- linkWithGold='false'
- enableLibraryProfiling='false'
- enableExecutableProfiling='false'
- doTracing='false'
- enableDWARFDebugging='false'
- doStrip='false'
- enableSharedLibraries='true'
- enableStaticLibraries='false'
- enableSharedExecutables='false'
- justStaticExecutables='false'
- enableSeparateBinOutput='false'
- checkUnusedPackages='false'
- doHaddock='false'
- doHyperlinkSource='false'
- doCoverage='false'
- doBenchmark='false'
2020-06-20 22:58:59 +02:00
- generateOptparseApplicativeCompletions='false'
2020-06-17 18:40:21 +02:00
- executableNamesToShellComplete='[ "hnix" ]'
2020-06-23 18:41:38 +02:00
#
2020-05-31 18:34:39 +02:00
- ghcjsTmpLogFile='/tmp/ghcjsTmpLogFile.log'
2020-06-20 22:58:59 +02:00
- ghcjsLogTailLength='10000'
2018-08-04 03:24:21 +02:00
2020-06-23 19:14:49 +02:00
# 2020-05-26: Currently newest Travis dist Ubuntu 18.04 bionic
# {os} x {jobs} + {jobs:include} - {jobs:exclude} = {build matrix}
2020-05-27 16:28:49 +02:00
jobs :
2020-06-12 17:03:07 +02:00
include :
2020-06-12 17:31:07 +02:00
- name : GHC 8.4.4, Linux
2020-06-17 14:55:32 +02:00
env :
2020-06-23 20:06:02 +02:00
- compiler='ghc844'
2020-06-20 22:58:59 +02:00
- linkWithGold='true'
2020-06-12 17:03:07 +02:00
os : linux
dist : bionic
2020-06-20 21:22:53 +02:00
- name : GHC 8.6.5, Linux
2020-06-12 17:03:07 +02:00
env :
2020-06-23 20:06:02 +02:00
- compiler='ghc865'
2020-06-20 22:58:59 +02:00
- linkWithGold='true'
2020-06-12 17:03:07 +02:00
os : linux
dist : bionic
2020-06-20 21:24:57 +02:00
- name : GHC 8.8.3, macOS, Strict
2020-06-12 17:03:07 +02:00
env :
2020-06-23 20:06:02 +02:00
- compiler='ghc883'
2020-06-20 22:58:59 +02:00
- buildStrictly='true'
2020-06-12 17:03:07 +02:00
os : osx
2020-06-17 14:56:29 +02:00
- name : GHC 8.10.1, Linux, SDist, Optimize, Benchmark, Haddock, Shell Completions
2020-06-12 17:03:07 +02:00
env :
2020-06-23 20:06:02 +02:00
- compiler='ghc8101'
2020-06-20 22:58:59 +02:00
- buildFromSdist='true'
- linkWithGold='true'
- doHaddock='true'
2020-06-23 19:48:49 +02:00
- doHyperlinkSource='true'
2020-06-20 22:58:59 +02:00
- doBenchmark='true'
- disableOptimization='false'
- enableDeadCodeElimination='true'
- generateOptparseApplicativeCompletions='true'
2020-06-12 17:03:07 +02:00
os : linux
dist : bionic
2020-06-12 17:31:07 +02:00
- name : GHCJS, Linux
2020-06-12 17:03:07 +02:00
env :
2020-06-23 20:06:02 +02:00
- compiler='ghcjs'
2020-06-12 17:03:07 +02:00
os : linux
dist : bionic
2020-05-27 16:28:49 +02:00
allow_failures :
2020-06-23 20:06:02 +02:00
- env : compiler='ghcjs'
2017-12-29 04:42:24 +01:00
2018-08-04 03:24:21 +02:00
before_script :
- sudo mount -o remount,exec,size=4G,mode=755 /run/user || true
- sudo mkdir -p /etc/nix
- echo "trusted-users = root $USER" | sudo tee -a /etc/nix/nix.conf
2020-06-12 15:22:14 +02:00
#
2020-06-23 19:14:49 +02:00
# Update Nix and Nix packages, Cachix requires that
2020-06-12 15:22:14 +02:00
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then nix upgrade-nix; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then sudo nix upgrade-nix; fi
#
2020-06-23 19:14:49 +02:00
# macOS service restart
# HACK: Because Nix can not itself update its daemon between 2.0 -> 2.2:
2020-06-12 15:26:38 +02:00
# 1. https://github.com/NixOS/nix/issues/3125#issuecomment-539667327
# 2. https://github.com/NixOS/nix/issues/3125#issuecomment-539771768
# Since Nix on macOS has problems restarting the service:
# Force the real disable, get target file from the symlink, unlink symlink, copy file, and reload service
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then true && \
sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
export NIX_SERVICE_FILE=$(readlink /Library/LaunchDaemons/org.nixos.nix-daemon.plist) && \
sudo unlink /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
sudo cp -f "$NIX_SERVICE_FILE" /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
sudo launchctl kickstart -k system/org.nixos.nix-daemon && \
true ; fi
2018-08-04 03:24:21 +02:00
2018-05-06 20:59:31 +02:00
script :
2020-05-27 23:23:33 +02:00
#
#
2020-06-23 19:14:49 +02:00
# Install Cachix client using Nix:
2020-06-12 15:22:55 +02:00
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then nix-env -iA cachix -f https://cachix.org/api/v1/install; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then sudo nix-env -iA cachix -f https://cachix.org/api/v1/install; fi
2020-06-23 18:09:01 +02:00
- cachix use "$project"
2020-06-23 19:14:49 +02:00
# If key is set - use Cachix push, else - proceed without it
2020-06-23 18:09:01 +02:00
- if [ ! "$CACHIX_SIGNING_KEY" = "" ]; then cachix push "$project" --watch-store& fi
2020-05-27 23:23:33 +02:00
#
#
2020-05-27 23:44:38 +02:00
# NOTE: Normal GHC build
2020-06-23 20:06:02 +02:00
- if [ ! "$compiler" = 'ghcjs' ]; then ./build.sh; fi
2020-05-27 23:44:38 +02:00
#
#
2020-05-27 23:45:15 +02:00
# NOTE: GHCJS build
# HACK: Travis terminates GHCJS because of very huge log,
# so `SILENT` mode for it was created
# and travis_wait 50 to wait on no outputs (otherwise Travis terminates build in 10 minutes as stale)
# and `bash` wrapper so Travis parses `travis_wait` => `if; then; fi` line
2020-06-23 20:06:02 +02:00
- travis_wait 50 bash -c 'if [ "$compiler" = "ghcjs" ]; then ./build.sh; fi'
2020-05-27 23:45:15 +02:00
# NOTE: For GHCJS dump the last $ghcjsLogTailLength lines into CI out to see
# Since build runs inside `travis_wait` - it was impossible to output log from it
2020-06-23 20:06:02 +02:00
- if [ "$compiler" = "ghcjs" ]; then tail -n "$ghcjsLogTailLength" "$ghcjsTmpLogFile" && rm "$ghcjsTmpLogFile"; fi
2020-05-27 23:45:15 +02:00
#
#
2018-04-03 09:31:30 +02:00
2020-05-27 16:40:55 +02:00
2020-06-23 19:14:49 +02:00
# Track the commits on this repo branches + cron rechecks build
2018-05-07 04:55:23 +02:00
branches :
only :
- master
2018-05-07 04:58:00 +02:00
- pending
2018-05-07 04:55:23 +02:00
2018-04-03 09:31:30 +02:00
notifications :
webhooks :
urls :
2018-04-27 00:58:51 +02:00
- https://webhooks.gitter.im/e/b0312b18473340459d3e
2020-06-23 19:14:49 +02:00
# Be silent about CI, until some PR started to pass CI succesfully.
2018-05-01 01:13:27 +02:00
on_success : change
2020-06-23 19:14:49 +02:00
# `master` status in on the front page badge.
2020-05-27 16:36:34 +02:00
on_failure : never
2018-05-01 01:13:27 +02:00
on_start : never