diff --git a/.github/workflows/ghc-lib.yml b/.github/workflows/ghc-lib.yml new file mode 100644 index 0000000000..976d26fdff --- /dev/null +++ b/.github/workflows/ghc-lib.yml @@ -0,0 +1,34 @@ +name: ghc-lib + +on: [pull_request] +jobs: + nix: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + ghc: ['ghc8102'] + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: cachix/install-nix-action@v12 + with: + nix_path: nixpkgs=channel:nixos-20.03 + - uses: cachix/cachix-action@v8 + with: + name: haskell-language-server + authToken: '${{ secrets.HLS_CACHIX_AUTH_TOKEN }}' + + - name: ghc-lib + run: | + echo "package ghcide" >> cabal.project.local + echo " flags: ghc-lib" >> cabal.project.local + echo "package hie-compat" >> cabal.project.local + echo " flags: ghc-lib" >> cabal.project.local + + - name: Build ghcide + run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build ghcide" diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 218983cb7c..5eaf670e33 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['default', 'ghc8102', 'ghc884', 'ghc865'] + ghc: ['ghc8101', 'ghc8102', 'ghc882', 'ghc883', 'ghc884', 'ghc865'] os: [ubuntu-latest, macOS-latest] steps: @@ -22,4 +22,25 @@ jobs: with: name: haskell-language-server authToken: '${{ secrets.HLS_CACHIX_AUTH_TOKEN }}' - - run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build" + + - name: Build + run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build" + + - name: Test ghcide + shell: bash + # run the tests without parallelism to avoid running out of memory + run: nix-shell --argstr compiler ${{ matrix.ghc}} --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 + # 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: nix-shell --argstr compiler ${{ matrix.ghc}} --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 + shell: bash + # 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: nix-shell --argstr compiler ${{ matrix.ghc}} --run "cabal test wrapper-test --test-options=-j1 || cabal test wrapper-test --test-options=-j1 || cabal test wrapper-test --test-options=-j1" diff --git a/.github/workflows/test.yml b/.github/workflows/windows.yml similarity index 67% rename from .github/workflows/test.yml rename to .github/workflows/windows.yml index d15b81b057..1c557ad395 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/windows.yml @@ -1,33 +1,13 @@ -name: Testing +name: Windows on: [pull_request] jobs: test: - runs-on: ${{ matrix.os }} + runs-on: windows-latest strategy: fail-fast: false 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] - exclude: - - os: windows-latest - ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550 - - os: windows-latest - ghc: "8.8.4" # also fails due to segfault :( - - os: windows-latest - 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 - - 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 + ghc: ["8.10.2.2", "8.10.1", "8.6.5"] steps: - uses: actions/checkout@v2 @@ -48,11 +28,11 @@ jobs: cache-name: cache-cabal with: path: ~/.cabal/ - key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} + key: ${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} restore-keys: | - ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}- - ${{ runner.os }}-${{ matrix.ghc }}-build- - ${{ runner.os }}-${{ matrix.ghc }} + ${{ matrix.ghc }}-build-${{ env.cache-name }}- + ${{ matrix.ghc }}-build- + ${{ matrix.ghc }} - run: cabal update @@ -72,13 +52,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 @@ -89,7 +67,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