Skip to content

Streamline CircleCI jobs #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 2 additions & 73 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ defaults: &defaults
- 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
Expand Down Expand Up @@ -56,13 +52,6 @@ defaults: &defaults
- ~/build/.stack-work
- ~/build/ghcide/.stack-work

- run:
name: Test ghcide
# Tests MUST run with -j1, since multiple ghc-mod sessions are not allowed
# command: stack -j 1 --stack-yaml=${STACK_FILE} test ghcide --dump-logs
command: echo "ghcide tests disabled until they got fixed, see https://github.com/mpickering/ghcide/issues/25"
no_output_timeout: 120m

- run:
name: Setup stack eval hie.html
command: cp plugins/hls-eval-plugin/test/testdata/hie-stack.yaml plugins/hls-eval-plugin/test/testdata/hie.yaml
Expand All @@ -72,30 +61,10 @@ defaults: &defaults
command: grep '^resolver:\|^compiler:' stack-build.txt > plugins/hls-eval-plugin/test/testdata/stack.yaml

- run:
name: Test haskell-language-server func-test suite
# Tasty by default will run all the tests in parallel. Which should
# work ok, but given that these CircleCI runners aren't the beefiest
# machine can cause some flakiness. So pass -j1 to Tasty (NOT Stack) to
# tell it to go slow and steady.
command: stack --stack-yaml=${STACK_FILE} test haskell-language-server:func-test --dump-logs --test-arguments="-j1 --rerun-update" || stack --stack-yaml=${STACK_FILE} test haskell-language-server:func-test --dump-logs --test-arguments="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true stack --stack-yaml=${STACK_FILE} test haskell-language-server:func-test --dump-logs --test-arguments="-j1 --rerun"
name: Build including tests
command: stack --stack-yaml=${STACK_FILE} test --no-run-tests
no_output_timeout: 120m

- run:
name: Test haskell-language-server wrapper-test suite
command: stack --stack-yaml=${STACK_FILE} test haskell-language-server:wrapper-test --dump-logs --test-arguments="-j1" || stack --stack-yaml=${STACK_FILE} test haskell-language-server:wrapper-test --dump-logs --test-arguments="-j1"
no_output_timeout: 30m

- run:
name: Test hls-tactics-plugin
command: stack --stack-yaml=${STACK_FILE} test hls-tactics-plugin:test:tests --dump-logs --test-arguments="-j1"
no_output_timeout: 30m

- 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" }}-{{ checksum "all-cabal.txt" }}
paths: *cache_paths
Expand Down Expand Up @@ -147,45 +116,6 @@ jobs:
- STACK_FILE: "stack.yaml"
<<: *defaults

cabal:
working_directory: ~/build
docker:
# We have to wait to a docker image with ghc-8.10.3
# See https://github.com/haskell/docker-haskell/issues/31
- image: haskell:8.10.2
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: Update
command: cabal new-update
- run:
name: Configure
command: cabal new-configure --enable-tests
- run:
name: Build dependencies
command: cabal new-build -j1 --dependencies-only # 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
- 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
Expand All @@ -200,4 +130,3 @@ workflows:
- ghc-8.10.2
- ghc-8.10.3
- ghc-default
- cabal