Skip to content

Commit

Permalink
Ci fixes (#783)
Browse files Browse the repository at this point in the history
* Drop macOS benchmarks

* Drop macOS tests

* Really exclude Windows 8.6.4

It occasionally becomes much slower than the others and times out after 6h

https://github.com/haskell/haskell-language-server/runs/1626173853?check_suite_focus=true

* switch to haskell/actions/setup

actions/setup-haskell has been archived, haskell/actions/setup is the replacement

* use coarser cache keys

We are getting very few cache hits because we have too many caches and are
running over the 5GB per repository limit.

Each node in the matrix weighs around 350MB, so we can have up to 15 nodes. The
current matrix (after dropping macOS but before adding 8.10.3) has 12 nodes.

The `**/*.cabal` hash is wrong, since it also captures cabal files in tests
The `**/cabal.project` is wrong for the same reason, but it can be easily
fixed.

* Use more precise .cabal paths in test cache

* Reuse build cache in bench workflows and viceversa

* Reduce Nix builds to the bare minimum

We simply need to check that the Nix derivation works

* remove enable-stack

* Auto cancel redundant workflows

* Enable tests fail-fast

* Remove ghc-lib from matrix

Created #784 to restore it
  • Loading branch information
pepeiborra committed Jan 1, 2021
1 parent 901974b commit aa7e9a3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/bench.yml
Expand Up @@ -9,12 +9,12 @@ jobs:
fail-fast: false
matrix:
ghc: ['8.10.2', '8.8.4', '8.6.5']
os: [ubuntu-latest, macOS-latest]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- run: git fetch origin master # check the master branch for benchmarking
- uses: actions/setup-haskell@v1
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
Expand All @@ -26,7 +26,11 @@ jobs:
path: |
~/.cabal/packages
~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-bench
key: ${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
${{ runner.os }}-${{ matrix.ghc }}-bench-
${{ runner.os }}-${{ matrix.ghc }}
- run: cabal update

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-haskell@v1
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
Expand Down Expand Up @@ -174,4 +174,3 @@ jobs:
asset_path: bin/haskell-language-server.tar.gz
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
asset_content_type: application/gzip

2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['default', 'ghc8102', 'ghc884', 'ghc865']
ghc: ['default']
os: [ubuntu-latest, macOS-latest]

steps:
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/test.yml
Expand Up @@ -5,11 +5,10 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
ghc: ["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, windows-latest]
ghc-lib: [false]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
Expand All @@ -19,25 +18,23 @@ jobs:
ghc: "8.8.3" # fails due to segfault
- os: windows-latest
ghc: "8.8.2" # fails due to error with Cabal
include:
- os: windows-latest
ghc: "8.6.4" # times out after 300m
include:
- os: windows-latest
ghc: "8.10.2.2" # only available for windows and choco
# one ghc-lib build
- os: ubuntu-latest
ghc: '8.10.1'
ghc-lib: true

steps:
# Cancel queued workflows from earlier commits in this branch
- uses: fkirc/skip-duplicate-actions@master

- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-haskell@v1
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.2"
enable-stack: true

- run: ./fmt.sh
name: "HLint via ./fmt.sh"
Expand All @@ -47,10 +44,12 @@ jobs:
env:
cache-name: cache-cabal
with:
path: ~/.cabal/
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
path: |
~/.cabal/packages
~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.ghc }}-bench-$${ hashFiles('cabal.project') }}
${{ runner.os }}-${{ matrix.ghc }}-build-
${{ runner.os }}-${{ matrix.ghc }}
Expand All @@ -72,13 +71,11 @@ jobs:
run: cabal build || cabal build || cabal build

- name: Test ghcide
if: ${{ !matrix.ghc-lib }}
shell: bash
# 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
if: ${{ !matrix.ghc-lib }}
shell: bash
env:
HLS_TEST_EXE: hls
Expand All @@ -89,7 +86,6 @@ jobs:
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"

- name: Test wrapper-test suite
if: ${{ !matrix.ghc-lib }}
shell: bash
env:
HLS_TEST_EXE: hls
Expand Down

0 comments on commit aa7e9a3

Please sign in to comment.