Skip to content
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

Test only last ghc minor version and fix windows cache #1173

Merged
merged 10 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
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
29 changes: 21 additions & 8 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,42 @@ pull_request_rules:
name: Automatically merge pull requests
conditions:
- status-success=bench (8.10.2, ubuntu-latest)
- status-success=bench (8.6.5, ubuntu-latest)
- status-success=bench (8.8.4, ubuntu-latest)
- status-success=nix (default, macOS-latest)
- status-success=bench (8.6.5, ubuntu-latest)

- status-success=nix (default, ubuntu-latest)
- status-success=nix (default, macOS-latest)

- status-success=test (8.10.3, ubuntu-latest)
- status-success=test (8.10.3, windows-latest)
- status-success=test (8.10.3, macOS-latest)
- status-success=test (8.10.2, ubuntu-latest)
- status-success=test (8.10.2, macOS-latest)
- status-success=test (8.10.1, ubuntu-latest)
- status-success=test (8.10.1, macOS-latest)
- status-success=test (8.8.4, ubuntu-latest)
- status-success=test (8.8.4, macOS-latest)
- status-success=test (8.8.3, ubuntu-latest)
- status-success=test (8.8.3, macOS-latest)
- status-success=test (8.8.2, ubuntu-latest)
- status-success=test (8.8.2, macOS-latest)
- status-success=test (8.6.5, ubuntu-latest)
- status-success=test (8.6.5, macOS-latest)
- status-success=test (8.6.4, ubuntu-latest)
- status-success=test (8.6.4, macOS-latest)
- status-success=test (windows-latest, 8.10.3, true)
- status-success=test (windows-latest, 8.6.5, true)
- status-success=test (windows-latest, 8.10.2.2)
- status-success=test (windows-latest, 8.10.1)
- status-success=test (windows-latest, 8.6.4)

- 'status-success=ci/circleci: ghc-8.10.1'
- 'status-success=ci/circleci: ghc-8.10.3'
- 'status-success=ci/circleci: ghc-8.6.4'
- 'status-success=ci/circleci: ghc-8.8.2'
- 'status-success=ci/circleci: ghc-8.8.3'
- 'status-success=ci/circleci: ghc-8.10.2'
- 'status-success=ci/circleci: ghc-8.6.5'
- 'status-success=ci/circleci: ghc-8.10.1'
- 'status-success=ci/circleci: ghc-8.8.4'
- 'status-success=ci/circleci: ghc-8.8.3'
- 'status-success=ci/circleci: ghc-8.8.2'
- 'status-success=ci/circleci: ghc-8.6.5'
- 'status-success=ci/circleci: ghc-8.6.4'
- 'status-success=ci/circleci: ghc-default'

- label=merge me
Expand Down
67 changes: 48 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
name: Testing

defaults:
run:
shell: bash

on: [pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
ghc: ['8.10.3', "8.10.2", "8.10.1", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
ghc: ["8.10.3", "8.10.2", "8.10.1", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
os: [ubuntu-latest, macOS-latest]
include:
# one ghc-lib build
# should be renabled: #784
# - os: ubuntu-latest
# ghc: '8.10.1'
# ghc-lib: true
# only test supported ghc major versions
- os: ubuntu-latest
ghc: '8.10.3'
test: true
- os: windows-latest
ghc: "8.8.4" # also fails due to segfault :(
ghc: '8.10.3'
test: true
- os: ubuntu-latest
ghc: '8.8.4'
test: true
- os: ubuntu-latest
ghc: '8.6.5'
test: true
- os: windows-latest
ghc: "8.8.3" # fails due to segfault
ghc: '8.6.5'
test: true
# only build rest of supported ghc versions for windows
- os: windows-latest
ghc: "8.8.2" # fails due to error with Cabal
ghc: '8.10.2.2'
- os: windows-latest
ghc: "8.6.4" # times out after 300m
include:
ghc: '8.10.1'
- os: windows-latest
ghc: "8.10.2.2" # only available for windows and choco
ghc: '8.6.4'

steps:
# Cancel queued workflows from earlier commits in this branch
Expand All @@ -39,14 +58,26 @@ jobs:
- run: ./fmt.sh
name: "HLint via ./fmt.sh"

- name: Set some window specific things
if: matrix.os == 'windows-latest'
run: |
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV

- name: Set some linux/macOS specific things
if: matrix.os != 'windows-latest'
run: |
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV

- name: Cache Cabal
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
${{ env.CABAL_PKGS_DIR }}
${{ env.CABAL_STORE_DIR }}
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }}
Expand All @@ -57,7 +88,6 @@ jobs:

# Need this to work around filepath length limits in Windows
- name: Shorten binary names
shell: bash
run: |
sed -i.bak -e 's/haskell-language-server/hls/g' \
-e 's/haskell_language_server/hls/g' \
Expand All @@ -66,27 +96,26 @@ jobs:
src/**/*.hs exe/*.hs

- name: Build
shell: bash
# Retry it three times to workaround compiler segfaults in windows
run: cabal build || cabal build || cabal build

- name: Test ghcide
shell: bash
if: ${{ matrix.test }}
# run the tests without parallelism to avoid running out of memory
run: cabal test ghcide --test-options="-j1 --rerun-update" || cabal test ghcide --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test ghcide --test-options="-j1 --rerun"

- name: Test func-test suite
shell: bash
if: ${{ matrix.test }}
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
# run the tests without parallelism, otherwise tasty will attempt to run
# all functional test cases simultaneously which causes way too many hls
# instances to be spun up for the poor github actions runner to handle
run: cabal test func-test --test-options="-j1 --rerun-update" || cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"
run: cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"

- name: Test wrapper-test suite
shell: bash
if: ${{ matrix.test }}
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package ghcide

write-ghc-environment-files: never

index-state: 2021-01-03T11:58:44Z
index-state: 2021-01-07T18:06:52Z

allow-newer:
active:base,
Expand Down
2 changes: 1 addition & 1 deletion ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description:
A library for building Haskell IDE's on top of the GHC API.
homepage: https://github.com/haskell/ghcide#readme
bug-reports: https://github.com/haskell/ghcide/issues
tested-with: GHC>=8.6.5
tested-with: GHC == 8.6.4 || == 8.6.5 || == 8.8.2 || == 8.8.3 || == 8.8.4 || == 8.10.1 || == 8.10.2 || == 8.10.3
extra-source-files: include/ghc-api-version.h README.md CHANGELOG.md
test/data/hover/*.hs
test/data/multi/cabal.project
Expand Down
1 change: 1 addition & 0 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ copyright: Alan Zimmerman
license: Apache-2.0
license-file: LICENSE
build-type: Simple
tested-with: GHC == 8.6.4 || == 8.6.5 || == 8.8.2 || == 8.8.3 || == 8.8.4 || == 8.10.1 || == 8.10.2 || == 8.10.3
extra-source-files:
README.md
ChangeLog.md
Expand Down