mirror of
https://github.com/haskell-nix/hnix.git
synced 2024-09-19 02:37:44 +03:00
2bd98c2d92
Since service is not touched the daemon-reload is probably not needed, restart is sufficient. M .travis.yml
160 lines
6.2 KiB
YAML
160 lines
6.2 KiB
YAML
# 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
|
|
|
|
# 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.
|
|
|
|
# NOTE: Let the official Travis YAML checker help you: https://config.travis-ci.com/explore
|
|
|
|
language: nix
|
|
|
|
sudo: required # 2020-05-26: This mode is deprecated, but still offers 7.5 GB RAM instead of the default 4GB
|
|
|
|
git:
|
|
quiet: true # Do not log
|
|
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."
|
|
|
|
# # 2020-05-26: Currently newest macOS image
|
|
# osx_image: xcode11.4 # Official Nix installer fails spectacularly on it.
|
|
|
|
env:
|
|
global:
|
|
# NOTE: This is secure CACHIX_SIGNING_KEY=val, it is only available on project internal branches, so Cachix would push only there
|
|
- secure: "dm6I+M4+V+C7QMTpcSADdKPE633SvmToXZrTbZ7miNDGmMN+/SfHeN2ybi1+PW6oViMlbPN/7J/aEfiGjSJI8vLk72Y4uCWGmpSb8TXZLu6+whnxtZzzW8+z4tsM4048QJg7CF3N/25U8thRFgs3DqUub1Sf3nG9LrNWdz6ZcDQ="
|
|
###
|
|
### NOTE: This configuration uses `build.sh` interface, which uses `default.nix` interface, which exposes the Nixpkgs Haskell Lib interface.
|
|
###
|
|
### 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
|
|
###
|
|
#
|
|
# - rev=nixos-unstable
|
|
# - NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"
|
|
- project='hnix'
|
|
- allowInconsistentDependencies='false'
|
|
- doJailbreak='false'
|
|
- doCheck='true'
|
|
- sdistTarball='false'
|
|
- buildFromSdist='false'
|
|
- buildStrictly='false'
|
|
- failOnAllWarnings='false'
|
|
- enableDeadCodeElimination='false'
|
|
- disableOptimization='true'
|
|
- 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'
|
|
- generateOptparseApplicativeCompletions='false'
|
|
- executableNamesToShellComplete='[ "hnix" ]'
|
|
#
|
|
- ghcjsTmpLogFile='/tmp/ghcjsTmpLogFile.log'
|
|
- ghcjsLogTailLength='10000'
|
|
|
|
# 2020-05-26: Currently newest Travis dist Ubuntu 18.04 bionic
|
|
# {os} x {jobs} + {jobs:include} - {jobs:exclude} = {build matrix}
|
|
jobs:
|
|
include:
|
|
- name: GHC 8.4.4, Linux
|
|
env:
|
|
- compiler='ghc844'
|
|
- linkWithGold='true'
|
|
os: linux
|
|
dist: bionic
|
|
- name: GHC 8.6.5, Linux
|
|
env:
|
|
- compiler='ghc865'
|
|
- linkWithGold='true'
|
|
os: linux
|
|
dist: bionic
|
|
- name: GHC 8.8.3, macOS, Strict
|
|
env:
|
|
- compiler='ghc883'
|
|
- buildStrictly='true'
|
|
os: osx
|
|
- name: GHC 8.10.1, Linux, SDist, Optimize, Benchmark, Haddock, Shell Completions
|
|
env:
|
|
- compiler='ghc8101'
|
|
- buildFromSdist='true'
|
|
- linkWithGold='true'
|
|
- doHaddock='true'
|
|
- doHyperlinkSource='true'
|
|
- doBenchmark='true'
|
|
- disableOptimization='false'
|
|
- enableDeadCodeElimination='true'
|
|
- generateOptparseApplicativeCompletions='true'
|
|
os: linux
|
|
dist: bionic
|
|
- name: GHCJS, Linux
|
|
env:
|
|
- compiler='ghcjs'
|
|
os: linux
|
|
dist: bionic
|
|
allow_failures:
|
|
- env: compiler='ghcjs'
|
|
|
|
before_script:
|
|
- sudo mkdir -p /etc/nix
|
|
- echo "trusted-users = root $USER" | sudo tee -a /etc/nix/nix.conf
|
|
# # Linux service restart
|
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then sudo systemctl restart nix-daemon.service;fi
|
|
# # macOS service restart
|
|
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then sudo launchctl kickstart -k system/org.nixos.nix-daemon; fi
|
|
|
|
script:
|
|
#
|
|
#
|
|
# Install Cachix client using Nix:
|
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ] || [ "${TRAVIS_OS_NAME}" = "osx" ]; then nix-env -iA cachix -f https://cachix.org/api/v1/install; fi
|
|
- cachix use "$project"
|
|
# If key is set - use Cachix push, else - proceed without it
|
|
- if [ ! "$CACHIX_SIGNING_KEY" = "" ]; then cachix push "$project" --watch-store& fi
|
|
#
|
|
#
|
|
# NOTE: Normal GHC build
|
|
- if [ ! "$compiler" = 'ghcjs' ]; then ./build.sh; fi
|
|
#
|
|
#
|
|
# 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
|
|
- travis_wait 50 bash -c 'if [ "$compiler" = "ghcjs" ]; then ./build.sh; fi'
|
|
# 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
|
|
- if [ "$compiler" = "ghcjs" ]; then tail -n "$ghcjsLogTailLength" "$ghcjsTmpLogFile" && rm "$ghcjsTmpLogFile"; fi
|
|
#
|
|
#
|
|
|
|
|
|
# Track the commits on this repo branches + cron rechecks build
|
|
branches:
|
|
only:
|
|
- master
|
|
- pending
|
|
|
|
notifications:
|
|
webhooks:
|
|
urls:
|
|
- https://webhooks.gitter.im/e/b0312b18473340459d3e
|
|
# Be silent about CI, until some PR started to pass CI succesfully.
|
|
on_success: change
|
|
# `master` status in on the front page badge.
|
|
on_failure: never
|
|
on_start: never
|