haskell-ide-engine/.circleci/config.yml
fendor 257eda54bb Drop stack support for GHC 8.2.2
This is necessary, because when we upgrade cabal-helper,
and transivitely cabal-plan to  version 0.5.0.0 in #1126,
the minimum cabal-version is 2.2.
However, each stack snapshot ships with its own version
of cabal-install that can not be changed.

The latest lts for ghc-8.2.2 is 11.18, which ships with
a cabal-install version of 2.0.0.1, which is too old
for cabal-plan 0.5.0.0.

However, in general, there is nothing that forces us to
drop support for GHC 8.2.2. Overriding the compiler version
should be possible, e.g. taking the snapshort 14.8 and
overriding the GHC version, but this requires us
to do manual constraint solving. Could be done if needed.
2019-10-31 10:52:11 +01:00

197 lines
5.5 KiB
YAML

defaults: &defaults
working_directory: ~/build
docker:
- image: alanz/haskell-hie-ci
steps:
- checkout
- run:
command: git submodule sync --recursive
- run:
command: git submodule update --recursive --init
- 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
command: find . -name "*.cabal" | grep -v -e "stack-work" -e "dist-newstyle" -e "submodules" -e "testdata" | sort | xargs cat > all-cabal.txt
- restore_cache:
keys:
- 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" }}
# - run:
# name: Stack upgrade
# command: stack upgrade
- run:
name: Stack setup
command: stack -j 2 --stack-yaml=${STACK_FILE} setup
- run:
name: Install happy
command: stack --stack-yaml=${STACK_FILE} install happy
- run:
name: Install Hoogle
command: stack -j 1 --stack-yaml=${STACK_FILE} install hoogle
- run:
name: Build (we need the exe for tests)
command: stack -j 1 --stack-yaml=${STACK_FILE} install
# need j1, else ghc-lib-parser triggers OOM
no_output_timeout: 30m
- run:
name: Build Testsuite without running it
command: stack -j 2 --stack-yaml=${STACK_FILE} build --test --no-run-tests
no_output_timeout: 30m
- store_artifacts:
path: ~/.local/bin
destination: bin
- run:
name: Generate Hoogle database
command: if [ ! -d ~/.hoogle ]; then stack --stack-yaml=${STACK_FILE} exec hoogle generate; fi
- run:
name: Clear cabal-helper cache
command: rm -fr ~/.cache/cabal-helper
- save_cache:
key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}
paths: &cache_paths
- ~/.stack
- ~/.cache
- ~/.hoogle
- ~/build/.stack-work
- ~/build/hie-plugin-api/.stack-work
- ~/build/submodules/HaRe/.stack-work
- ~/build/submodules/brittany/.stack-work
- ~/build/submodules/ghc-mod/core/.stack-work
- ~/build/submodules/ghc-mod/.stack-work
- ~/build/submodules/cabal-helper/.stack-work
- run:
name: Test
# Tests MUST run with -j1, since multiple ghc-mod sessions are not allowed
command: stack -j 1 --stack-yaml=${STACK_FILE} test --dump-logs
no_output_timeout: 120m
- store_test_results:
path: test-results
- store_artifacts:
path: test-logs
- save_cache:
key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
paths: *cache_paths
- save_cache:
key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }}
paths: *cache_paths
version: 2
jobs:
ghc-8.4.2:
environment:
- STACK_FILE: "stack-8.4.2.yaml"
<<: *defaults
ghc-8.4.3:
environment:
- STACK_FILE: "stack-8.4.3.yaml"
<<: *defaults
ghc-8.4.4:
environment:
- STACK_FILE: "stack-8.4.4.yaml"
<<: *defaults
ghc-8.6.1:
environment:
- STACK_FILE: "stack-8.6.1.yaml"
<<: *defaults
ghc-8.6.2:
environment:
- STACK_FILE: "stack-8.6.2.yaml"
<<: *defaults
ghc-8.6.3:
environment:
- STACK_FILE: "stack-8.6.3.yaml"
<<: *defaults
ghc-8.6.4:
environment:
- STACK_FILE: "stack-8.6.4.yaml"
<<: *defaults
ghc-8.6.5:
environment:
- STACK_FILE: "stack-8.6.5.yaml"
<<: *defaults
ghc-nightly:
environment:
- STACK_FILE: "stack.yaml"
<<: *defaults
cabal:
working_directory: ~/build
docker:
- image: quay.io/haskell_works/ghc-8.6.5
steps:
- checkout
- run:
name: Sync submodules
command: git submodule sync --recursive
- run:
name: Update submodules
command: git submodule update --recursive --init
- restore-cache:
keys:
- cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- run:
name: Cabal version
command: cabal --version
- run:
name: Update
command: cabal new-update
- run:
name: Configure
command: cabal new-configure --enable-tests
- run:
name: Build
command: cabal new-build -j1 # need j1, else ghc-lib-parser triggers OOM
no_output_timeout: 30m
- save_cache:
key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
paths:
- ~/.cabal
workflows:
version: 2
multiple-ghcs:
jobs:
- ghc-8.4.2
- ghc-8.4.3
- ghc-8.4.4
- ghc-8.6.1
- ghc-8.6.2
# - ghc-8.6.3
- ghc-8.6.4
- ghc-8.6.5
- ghc-nightly
- cabal