name: Testing on: [pull_request] jobs: test: timeout-minutes: 360 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: # all versions to only build or test for non windows os's # inclusions will modify the major ones to mark them as testables os: [macOS-latest, ubuntu-latest] ghc: ['8.10.2', '8.10.1', '8.8.4', '8.8.3', '8.8.2', '8.6.5', '8.6.4'] ghc-lib: [false] include: # one ghc-lib build - os: ubuntu-latest ghc: '8.10.1' ghc-lib: true # only test supported ghc major versions - os: macOS-latest ghc: '8.10.2' test: true - os: ubuntu-latest ghc: '8.10.2' test: true # specific 8.10.2 version for windows and chocolatey - os: windows-latest ghc: '8.10.2.2' test: true - os: macOS-latest ghc: '8.8.4' test: true - os: ubuntu-latest ghc: '8.8.4' test: true - os: macOS-latest ghc: '8.6.5' test: true - os: ubuntu-latest ghc: '8.6.5' test: true - os: windows-latest ghc: '8.6.5' test: true # only build rest of supported ghc versions for windows - os: windows-latest ghc: '8.10.1' - os: windows-latest ghc: '8.6.4' steps: - uses: actions/checkout@v2 - uses: actions/setup-haskell@v1 with: ghc-version: ${{ matrix.ghc }} cabal-version: '3.2' - run: ./fmt.sh name: "HLint via ./fmt.sh" - name: Cache Cabal uses: actions/cache@v2 with: path: | ~/.cabal/packages ~/.cabal/store key: ${{ runner.os }}-${{ matrix.ghc }}-{{matrix.ghc-lib}}-cabal-test - run: cabal update - name: cabal.project.local run: | echo "tests: True" > cabal.project.local echo "package ghcide" >> cabal.project.local echo " ghc-options: -Werror" >> cabal.project.local - name: ghc-lib if: ${{ matrix.ghc-lib }} run: | echo " flags: ghc-lib" >> cabal.project.local echo "package hie-compat" >> cabal.project.local echo " flags: ghc-lib" >> cabal.project.local - name: Build shell: bash # Retry it three times to workaround compiler segfaults in windows run: cabal build || cabal build || cabal build - name: Test if: ${{ !matrix.ghc-lib && matrix.test }} shell: bash # run the tests without parallelism to avoid running out of memory run: cabal test --test-options="-j1 --rerun-update" || cabal test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test --test-options="-j1 --rerun"