Experiment with loading matrix values from a file (#3481)

* Experiment with loading matrix values from a file

The goal here is to avoid duplication of e.g. which versions of GHC we
support.

This is an experiment at the moment.

* fix some warnings in hlint plugin
This commit is contained in:
Michael Peyton Jones 2023-02-13 16:17:01 +00:00 committed by GitHub
parent d3a5ee1a6d
commit efbf253d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 51 deletions

View File

@ -46,8 +46,11 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10.7', '9.2.5']
os: [ubuntu-latest]
ghc:
- '8.10.7'
- '9.2.5'
os:
- ubuntu-latest
# This code is fitted to the strategy: assumes Linux is used ... etc,
# change of the strategy may require changing the bootstrapping/run code

View File

@ -54,8 +54,13 @@ jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
ghcs: ${{ steps.ghcs.outputs.ghcs }}
should_skip: ${{ steps.skip_check.outputs.should_skip }}
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/skip-duplicate-actions@v5.3.0
with:
@ -80,17 +85,11 @@ jobs:
strategy:
fail-fast: false
matrix:
# This list of GHC (including the "exclude" list) versions must match
# to the list of GHC versions specified in 'test.yml'
ghc: [ "9.4.4"
, "9.2.5"
, "9.0.2"
, "8.10.7"
]
os: [ "ubuntu-latest"
, "macOS-latest"
, "windows-latest"
]
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }}
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v3

View File

@ -18,8 +18,13 @@ jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
ghcs: ${{ steps.ghcs.outputs.ghcs }}
should_skip: ${{ steps.skip_check.outputs.should_skip }}
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/skip-duplicate-actions@v5.3.0
with:
@ -44,12 +49,9 @@ jobs:
strategy:
fail-fast: true
matrix:
ghc: [ "9.2.5"
, "9.0.2"
, "8.10.7"
]
os: [ "ubuntu-latest"
]
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }}
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v3

View File

@ -0,0 +1 @@
[ "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]

View File

@ -20,7 +20,12 @@ jobs:
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/skip-duplicate-actions@v5.3.0
with:
@ -52,7 +57,8 @@ jobs:
test:
if: needs.pre_job.outputs.should_skip != 'true'
needs: pre_job
needs:
- pre_job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
@ -60,41 +66,17 @@ jobs:
# **don't forget**
# to update the ghc versions in 'caching.yml'.
matrix:
ghc: [ "9.4.4"
, "9.2.5"
, "9.0.2"
, "8.10.7"
]
os: [ "ubuntu-latest"
, "macOS-latest"
, "windows-latest"
]
# Mark which GHC versions on which platform we want to test.
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:
# only test supported ghc major versions
# Test all supported versions, but only on ubuntu and windows
- os: ubuntu-latest
ghc: '9.4.4'
test: true
- os: ubuntu-latest
ghc: '9.2.5'
test: true
- os: ubuntu-latest
ghc: '9.0.2'
test: true
- os: ubuntu-latest
ghc: '8.10.7'
test: true
- os: windows-latest
ghc: '9.4.4'
test: true
- os: windows-latest
ghc: '9.2.5'
test: true
- os: windows-latest
ghc: '9.0.2'
test: true
- os: windows-latest
ghc: '8.10.7'
test: true
steps:

View File

@ -20,6 +20,11 @@
{-# OPTIONS_GHC -Wno-orphans #-}
-- On 9.4 we get a new redundant constraint warning, but deleting the
-- constraint breaks the build on earlier versions. Rather than apply
-- lots of CPP, we just disable the warning until later.
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
#ifdef HLINT_ON_GHC_LIB
#define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc_lib_parser(x,y,z)
#else
@ -134,8 +139,11 @@ import Development.IDE.Spans.Pragmas (LineSplitTe
lineSplitTextEdits,
nextPragmaLine)
import GHC.Generics (Generic)
#if MIN_VERSION_apply_refact(0,12,0)
#else
import System.Environment (setEnv,
unsetEnv)
#endif
import Text.Regex.TDFA.Text ()
-- ---------------------------------------------------------------------