2018-03-27 12:26:19 +03:00
|
|
|
defaults: &defaults
|
|
|
|
working_directory: ~/build
|
|
|
|
docker:
|
2018-08-20 00:32:08 +03:00
|
|
|
- image: alanz/haskell-hie-ci
|
2018-03-27 12:26:19 +03:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-04-16 00:29:21 +03:00
|
|
|
- run:
|
|
|
|
command: git submodule sync --recursive
|
|
|
|
- run:
|
|
|
|
command: git submodule update --recursive --init
|
2018-03-27 12:26:19 +03:00
|
|
|
- run:
|
|
|
|
name: Write provided stack.yaml with predictable name
|
|
|
|
command: cp ${STACK_FILE} stack-build.txt
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Figure out resolver for better caching
|
|
|
|
command: grep '^resolver:' stack-build.txt > resolver.txt
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Create a composite cabal file for changes detection
|
2019-01-08 07:17:44 +03:00
|
|
|
command: find . -name "*.cabal" | grep -v -e "stack-work" -e "dist-newstyle" -e "submodules" -e "testdata" | sort | xargs cat > all-cabal.txt
|
2018-03-27 12:26:19 +03:00
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2018-12-06 17:22:55 +03:00
|
|
|
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }}
|
|
|
|
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
|
|
|
|
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}
|
2018-03-27 12:26:19 +03:00
|
|
|
|
2019-10-25 16:44:11 +03:00
|
|
|
- run:
|
|
|
|
name: Stack upgrade
|
|
|
|
command: stack upgrade
|
2019-10-14 22:49:12 +03:00
|
|
|
|
2018-03-27 12:26:19 +03:00
|
|
|
- run:
|
|
|
|
name: Stack setup
|
|
|
|
command: stack -j 2 --stack-yaml=${STACK_FILE} setup
|
|
|
|
|
2018-06-18 13:16:56 +03:00
|
|
|
- run:
|
|
|
|
name: Install happy
|
|
|
|
command: stack --stack-yaml=${STACK_FILE} install happy
|
|
|
|
|
2018-03-27 12:26:19 +03:00
|
|
|
- run:
|
|
|
|
name: Install Hoogle
|
2019-10-22 19:57:35 +03:00
|
|
|
command: stack -j 1 --stack-yaml=${STACK_FILE} install hoogle
|
2018-03-27 12:26:19 +03:00
|
|
|
|
2018-04-30 17:00:12 +03:00
|
|
|
- run:
|
2018-11-27 09:52:24 +03:00
|
|
|
name: Build (we need the exe for tests)
|
2019-05-25 18:10:14 +03:00
|
|
|
command: stack -j 1 --stack-yaml=${STACK_FILE} install
|
|
|
|
# need j1, else ghc-lib-parser triggers OOM
|
2019-05-25 15:59:48 +03:00
|
|
|
no_output_timeout: 30m
|
2018-04-30 17:00:12 +03:00
|
|
|
|
2018-11-27 09:52:24 +03:00
|
|
|
- run:
|
|
|
|
name: Build Testsuite without running it
|
|
|
|
command: stack -j 2 --stack-yaml=${STACK_FILE} build --test --no-run-tests
|
2019-05-25 15:59:48 +03:00
|
|
|
no_output_timeout: 30m
|
2018-11-27 09:52:24 +03:00
|
|
|
|
2018-08-07 14:59:54 +03:00
|
|
|
- store_artifacts:
|
2018-08-07 15:17:27 +03:00
|
|
|
path: ~/.local/bin
|
2018-08-07 14:59:54 +03:00
|
|
|
destination: bin
|
|
|
|
|
2018-06-30 01:48:28 +03:00
|
|
|
- run:
|
|
|
|
name: Generate Hoogle database
|
2019-01-08 03:24:36 +03:00
|
|
|
command: if [ ! -d ~/.hoogle ]; then stack --stack-yaml=${STACK_FILE} exec hoogle generate; fi
|
2018-06-30 01:48:28 +03:00
|
|
|
|
2018-10-28 17:04:30 +03:00
|
|
|
- run:
|
|
|
|
name: Clear cabal-helper cache
|
|
|
|
command: rm -fr ~/.cache/cabal-helper
|
|
|
|
|
2018-03-27 12:26:19 +03:00
|
|
|
- save_cache:
|
2018-12-06 17:22:55 +03:00
|
|
|
key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}
|
2018-12-09 01:13:49 +03:00
|
|
|
paths: &cache_paths
|
2018-03-27 12:26:19 +03:00
|
|
|
- ~/.stack
|
|
|
|
- ~/.cache
|
2019-01-08 01:36:30 +03:00
|
|
|
- ~/.hoogle
|
2018-09-06 20:38:01 +03:00
|
|
|
- ~/build/.stack-work
|
|
|
|
- ~/build/hie-plugin-api/.stack-work
|
2018-09-09 14:08:06 +03:00
|
|
|
- ~/build/submodules/HaRe/.stack-work
|
2018-12-09 01:13:49 +03:00
|
|
|
- ~/build/submodules/brittany/.stack-work
|
2018-09-09 14:08:06 +03:00
|
|
|
- ~/build/submodules/ghc-mod/core/.stack-work
|
|
|
|
- ~/build/submodules/ghc-mod/.stack-work
|
|
|
|
- ~/build/submodules/cabal-helper/.stack-work
|
2018-03-27 12:26:19 +03:00
|
|
|
|
|
|
|
- run:
|
2018-07-21 21:05:21 +03:00
|
|
|
name: Test
|
2018-10-29 15:46:03 +03:00
|
|
|
# Tests MUST run with -j1, since multiple ghc-mod sessions are not allowed
|
|
|
|
command: stack -j 1 --stack-yaml=${STACK_FILE} test --dump-logs
|
2018-03-27 12:26:19 +03:00
|
|
|
no_output_timeout: 120m
|
2018-06-11 19:04:50 +03:00
|
|
|
|
2019-01-07 22:47:22 +03:00
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
|
|
|
|
2018-06-11 19:04:50 +03:00
|
|
|
- store_artifacts:
|
2018-06-11 17:16:33 +03:00
|
|
|
path: test-logs
|
2018-03-27 12:26:19 +03:00
|
|
|
|
|
|
|
- save_cache:
|
2018-12-06 17:22:55 +03:00
|
|
|
key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
|
2018-12-09 01:13:49 +03:00
|
|
|
paths: *cache_paths
|
2018-03-27 12:26:19 +03:00
|
|
|
|
|
|
|
- save_cache:
|
2018-12-06 17:22:55 +03:00
|
|
|
key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }}
|
2018-12-09 01:13:49 +03:00
|
|
|
paths: *cache_paths
|
2018-03-27 12:26:19 +03:00
|
|
|
|
2018-03-21 18:12:12 +03:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-04-25 23:42:30 +03:00
|
|
|
ghc-8.4.2:
|
2018-06-02 12:56:36 +03:00
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.4.2.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
|
|
|
ghc-8.4.3:
|
2018-07-10 14:54:51 +03:00
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.4.3.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
2018-10-27 18:50:58 +03:00
|
|
|
ghc-8.4.4:
|
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.4.4.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
2019-03-07 20:06:25 +03:00
|
|
|
ghc-8.6.4:
|
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.6.4.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
2019-05-04 11:42:55 +03:00
|
|
|
ghc-8.6.5:
|
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.6.5.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
2020-01-26 17:59:20 +03:00
|
|
|
ghc-8.8.2:
|
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.8.2.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
2020-03-12 12:33:55 +03:00
|
|
|
ghc-8.8.3:
|
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack-8.8.3.yaml"
|
|
|
|
<<: *defaults
|
|
|
|
|
2018-07-10 14:54:51 +03:00
|
|
|
ghc-nightly:
|
2018-03-27 12:26:19 +03:00
|
|
|
environment:
|
|
|
|
- STACK_FILE: "stack.yaml"
|
|
|
|
<<: *defaults
|
2018-03-21 18:19:49 +03:00
|
|
|
|
2018-07-21 22:15:04 +03:00
|
|
|
cabal:
|
2018-07-27 00:02:36 +03:00
|
|
|
working_directory: ~/build
|
|
|
|
docker:
|
2019-12-29 01:31:32 +03:00
|
|
|
- image: haskell:8.8.1
|
2018-07-21 22:15:04 +03:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-07-27 00:17:57 +03:00
|
|
|
- run:
|
|
|
|
name: Sync submodules
|
2018-07-27 00:02:36 +03:00
|
|
|
command: git submodule sync --recursive
|
|
|
|
- run:
|
2018-07-27 00:17:57 +03:00
|
|
|
name: Update submodules
|
2018-07-27 00:02:36 +03:00
|
|
|
command: git submodule update --recursive --init
|
2018-07-21 22:40:33 +03:00
|
|
|
- restore-cache:
|
2018-07-27 00:02:36 +03:00
|
|
|
keys:
|
2018-12-06 17:22:55 +03:00
|
|
|
- cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
|
2018-07-22 15:20:18 +03:00
|
|
|
- run:
|
|
|
|
name: Update
|
2019-12-29 01:31:32 +03:00
|
|
|
command: cabal update
|
2018-07-21 22:15:04 +03:00
|
|
|
- run:
|
2018-07-21 22:40:33 +03:00
|
|
|
name: Configure
|
2019-12-29 01:31:32 +03:00
|
|
|
command: cabal configure --enable-tests
|
2018-07-21 22:15:04 +03:00
|
|
|
- run:
|
2018-07-21 22:40:33 +03:00
|
|
|
name: Build
|
2019-12-29 01:31:32 +03:00
|
|
|
command: cabal build -j1 # need j1, else ghc-lib-parser triggers OOM
|
2019-05-25 16:49:45 +03:00
|
|
|
no_output_timeout: 30m
|
2018-07-21 22:15:04 +03:00
|
|
|
- save_cache:
|
2018-12-06 17:22:55 +03:00
|
|
|
key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
|
2018-07-21 22:15:04 +03:00
|
|
|
paths:
|
2018-07-23 14:14:28 +03:00
|
|
|
- ~/.cabal
|
2018-07-21 22:15:04 +03:00
|
|
|
|
|
|
|
|
2018-03-21 18:12:12 +03:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
multiple-ghcs:
|
|
|
|
jobs:
|
2018-04-25 23:42:30 +03:00
|
|
|
- ghc-8.4.2
|
2018-06-02 12:56:36 +03:00
|
|
|
- ghc-8.4.3
|
2018-10-27 18:50:58 +03:00
|
|
|
- ghc-8.4.4
|
2019-03-07 20:06:25 +03:00
|
|
|
- ghc-8.6.4
|
2019-05-04 11:42:55 +03:00
|
|
|
- ghc-8.6.5
|
2020-01-26 17:59:20 +03:00
|
|
|
- ghc-8.8.2
|
2020-03-12 15:48:52 +03:00
|
|
|
- ghc-8.8.3
|
2018-07-10 14:54:51 +03:00
|
|
|
- ghc-nightly
|
2018-07-21 22:15:04 +03:00
|
|
|
- cabal
|