Drop support for GHC 9.0 #9363
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
defaults: | |
run: | |
shell: bash | |
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. | |
concurrency: | |
group: ${{ github.head_ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
pre_job: | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
should_skip_ghcide: ${{ steps.skip_ghcide_check.outputs.should_skip }} | |
ghcs: ${{ steps.ghcs.outputs.ghcs }} | |
steps: | |
# Need the repo checked out in order to read the file | |
- uses: actions/checkout@v3 | |
- id: ghcs | |
run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT | |
- id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
cancel_others: false | |
paths_ignore: '[ "**/docs/**" | |
, "**.md" | |
, "**/LICENSE" | |
, "**.nix" | |
, "flake.lock" | |
, "**/README.md" | |
, "FUNDING.yml" | |
, ".circleci/**" | |
, "**/stack*.yaml" | |
, ".gitlab-ci.yaml" | |
, ".gitlab/**" | |
, "CODEOWNERS" | |
]' | |
# If we only change ghcide downstream packages we have not test ghcide itself | |
- id: skip_ghcide_check | |
uses: fkirc/[email protected] | |
with: | |
cancel_others: false | |
paths_ignore: '[ "hls-test-utils/**" | |
, "plugins/**" | |
, "src/**" | |
, "exe/**" | |
, "test/**" | |
, "shake-bench/**" | |
]' | |
test: | |
if: needs.pre_job.outputs.should_skip != 'true' | |
needs: | |
- pre_job | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# We don't want to fail fast. | |
# We used to fail fast, to avoid caches of failing PRs to overpopulate the CI | |
# caches, evicting known good build caches. | |
# However, PRs do not cache anything any more, and can only use the caches from current master. | |
# See 'caching.yml' for our caching set up. | |
fail-fast: false | |
matrix: | |
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }} | |
os: | |
- ubuntu-latest | |
- macOS-latest | |
- windows-latest | |
# Mark which GHC versions on which platforms we want to test. | |
include: | |
# Test all supported versions, but only on ubuntu and windows | |
- os: ubuntu-latest | |
test: true | |
- os: windows-latest | |
test: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-build | |
with: | |
ghc: ${{ matrix.ghc }} | |
os: ${{ runner.os }} | |
- name: Build | |
run: cabal build | |
- name: Set test options | |
# 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: | | |
echo "TEST_OPTS=-j1 --rerun-update --rerun-filter failures,exceptions" >> $GITHUB_ENV | |
- name: Cache test log between attempts of the same run | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-test-log | |
with: | |
path: "**/.tasty-rerun-log*" | |
key: v1-${{ runner.os }}-${{ matrix.ghc }}-test-log-${{ github.sha }} | |
- if: matrix.test | |
name: Test hls-graph | |
run: cabal test hls-graph --test-options="$TEST_OPTS" | |
- if: needs.pre_job.outputs.should_skip_ghcide != 'true' && matrix.test | |
name: Test ghcide | |
# run the tests without parallelism to avoid running out of memory | |
run: cabal test ghcide --test-options="$TEST_OPTS" || cabal test ghcide --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-plugin-api | |
run: cabal test hls-plugin-api --test-options="$TEST_OPTS" || cabal test hls-plugin-api --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test func-test suite | |
env: | |
HLS_TEST_EXE: hls | |
HLS_WRAPPER_TEST_EXE: hls-wrapper | |
run: cabal test func-test --test-options="$TEST_OPTS" || cabal test func-test --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test wrapper-test suite | |
env: | |
HLS_TEST_EXE: hls | |
HLS_WRAPPER_TEST_EXE: hls-wrapper | |
run: cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-refactor-plugin | |
run: cabal test hls-refactor-plugin --test-options="$TEST_OPTS" || cabal test hls-refactor-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && matrix.ghc != '9.6' && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-floskell-plugin | |
run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || cabal test hls-floskell-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-class-plugin | |
run: cabal test hls-class-plugin --test-options="$TEST_OPTS" || cabal test hls-class-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-pragmas-plugin | |
run: cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-eval-plugin | |
run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || cabal test hls-eval-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-splice-plugin | |
run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || cabal test hls-splice-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && matrix.ghc != '9.2' | |
name: Test hls-stan-plugin | |
run: cabal test hls-stan-plugin --test-options="$TEST_OPTS" || cabal test hls-stan-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-stylish-haskell-plugin | |
run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-ormolu-plugin | |
run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-fourmolu-plugin | |
run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-explicit-imports-plugin test suite | |
run: cabal test hls-explicit-imports-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-imports-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-call-hierarchy-plugin test suite | |
run: cabal test hls-call-hierarchy-plugin --test-options="$TEST_OPTS" || cabal test hls-call-hierarchy-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && matrix.os != 'windows-latest' && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-rename-plugin test suite | |
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || cabal test hls-rename-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-hlint-plugin test suite | |
run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-module-name-plugin test suite | |
run: cabal test hls-module-name-plugin --test-options="$TEST_OPTS" || cabal test hls-module-name-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-alternate-number-format-plugin test suite | |
run: cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" || cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-qualify-imported-names-plugin test suite | |
run: cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" || cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-code-range-plugin test suite | |
run: cabal test hls-code-range-plugin --test-options="$TEST_OPTS" || cabal test hls-code-range-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-change-type-signature test suite | |
run: cabal test hls-change-type-signature-plugin --test-options="$TEST_OPTS" || cabal test hls-change-type-signature-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-gadt-plugin test suit | |
run: cabal test hls-gadt-plugin --test-options="$TEST_OPTS" || cabal test hls-gadt-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-explicit-fixity-plugin test suite | |
run: cabal test hls-explicit-fixity-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-fixity-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-explicit-record-fields-plugin test suite | |
run: cabal test hls-explicit-record-fields-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-record-fields-plugin --test-options="$TEST_OPTS" | |
## version needs to be limited since the tests depend on cabal-fmt which only builds using specific ghc versions | |
- if: matrix.test && matrix.ghc == '9.2' | |
name: Test hls-cabal-fmt-plugin test suite | |
run: cabal test hls-cabal-fmt-plugin --flag=isolateTests --test-options="$TEST_OPTS" || cabal test hls-cabal-fmt-plugin --flag=isolateTests --test-options="$TEST_OPTS" | |
- if: matrix.test | |
name: Test hls-cabal-plugin test suite | |
run: cabal test hls-cabal-plugin --test-options="$TEST_OPTS" || cabal test hls-cabal-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && !startsWith(matrix.ghc,'9.8') | |
name: Test hls-retrie-plugin test suite | |
run: cabal test hls-retrie-plugin --test-options="$TEST_OPTS" || cabal test hls-retrie-plugin --test-options="$TEST_OPTS" | |
- if: matrix.test && matrix.ghc != '9.0' | |
name: Test hls-overloaded-record-dot-plugin test suite | |
run: cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" | |
test_post_job: | |
if: always() | |
runs-on: ubuntu-latest | |
needs: [pre_job, test] | |
steps: | |
- run: | | |
echo "jobs info: ${{ toJSON(needs) }}" | |
- if: contains(needs.*.result, 'failure') | |
run: exit 1 | |
- if: contains(needs.*.result, 'cancelled') && needs.pre_job.outputs.should_skip != 'true' | |
run: exit 1 |