Skip to content

Commit 2f54099

Browse files
michaelpjwz1000
authored andcommitted
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
1 parent 4a7ad18 commit 2f54099

File tree

6 files changed

+46
-51
lines changed

6 files changed

+46
-51
lines changed

.github/workflows/bench.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ jobs:
4646
strategy:
4747
fail-fast: false
4848
matrix:
49-
ghc: ['8.10.7', '9.2.5']
50-
os: [ubuntu-latest]
49+
ghc:
50+
- '8.10.7'
51+
- '9.2.5'
52+
os:
53+
- ubuntu-latest
5154

5255
# This code is fitted to the strategy: assumes Linux is used ... etc,
5356
# change of the strategy may require changing the bootstrapping/run code

.github/workflows/caching.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ jobs:
5454
pre_job:
5555
runs-on: ubuntu-latest
5656
outputs:
57+
ghcs: ${{ steps.ghcs.outputs.ghcs }}
5758
should_skip: ${{ steps.skip_check.outputs.should_skip }}
5859
steps:
60+
# Need the repo checked out in order to read the file
61+
- uses: actions/checkout@v3
62+
- id: ghcs
63+
run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT
5964
- id: skip_check
6065
uses: fkirc/[email protected]
6166
with:
@@ -80,17 +85,11 @@ jobs:
8085
strategy:
8186
fail-fast: false
8287
matrix:
83-
# This list of GHC (including the "exclude" list) versions must match
84-
# to the list of GHC versions specified in 'test.yml'
85-
ghc: [ "9.4.4"
86-
, "9.2.5"
87-
, "9.0.2"
88-
, "8.10.7"
89-
]
90-
os: [ "ubuntu-latest"
91-
, "macOS-latest"
92-
, "windows-latest"
93-
]
88+
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }}
89+
os:
90+
- ubuntu-latest
91+
- macOS-latest
92+
- windows-latest
9493
steps:
9594
- uses: actions/checkout@v3
9695

.github/workflows/flags.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ jobs:
1818
pre_job:
1919
runs-on: ubuntu-latest
2020
outputs:
21+
ghcs: ${{ steps.ghcs.outputs.ghcs }}
2122
should_skip: ${{ steps.skip_check.outputs.should_skip }}
2223
steps:
24+
# Need the repo checked out in order to read the file
25+
- uses: actions/checkout@v3
26+
- id: ghcs
27+
run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT
2328
- id: skip_check
2429
uses: fkirc/[email protected]
2530
with:
@@ -44,12 +49,9 @@ jobs:
4449
strategy:
4550
fail-fast: true
4651
matrix:
47-
ghc: [ "9.2.5"
48-
, "9.0.2"
49-
, "8.10.7"
50-
]
51-
os: [ "ubuntu-latest"
52-
]
52+
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }}
53+
os:
54+
- ubuntu-latest
5355

5456
steps:
5557
- uses: actions/checkout@v3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]

.github/workflows/test.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ jobs:
2020
outputs:
2121
should_skip: ${{ steps.skip_check.outputs.should_skip }}
2222
should_skip_ghcide: ${{ steps.skip_ghcide_check.outputs.should_skip }}
23+
ghcs: ${{ steps.ghcs.outputs.ghcs }}
2324
steps:
25+
# Need the repo checked out in order to read the file
26+
- uses: actions/checkout@v3
27+
- id: ghcs
28+
run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT
2429
- id: skip_check
2530
uses: fkirc/[email protected]
2631
with:
@@ -52,49 +57,26 @@ jobs:
5257

5358
test:
5459
if: needs.pre_job.outputs.should_skip != 'true'
55-
needs: pre_job
60+
needs:
61+
- pre_job
5662
runs-on: ${{ matrix.os }}
5763
strategy:
5864
fail-fast: true
5965
# when you edit this list of GHC versions,
6066
# **don't forget**
6167
# to update the ghc versions in 'caching.yml'.
6268
matrix:
63-
ghc: [ "9.4.4"
64-
, "9.2.5"
65-
, "9.0.2"
66-
, "8.10.7"
67-
]
68-
os: [ "ubuntu-latest"
69-
, "macOS-latest"
70-
, "windows-latest"
71-
]
72-
# Mark which GHC versions on which platform we want to test.
69+
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }}
70+
os:
71+
- ubuntu-latest
72+
- macOS-latest
73+
- windows-latest
74+
# Mark which GHC versions on which platforms we want to test.
7375
include:
74-
# only test supported ghc major versions
75-
- os: ubuntu-latest
76-
ghc: '9.4.4'
77-
test: true
78-
- os: ubuntu-latest
79-
ghc: '9.2.5'
80-
test: true
81-
- os: ubuntu-latest
82-
ghc: '9.0.2'
83-
test: true
76+
# Test all supported versions, but only on ubuntu and windows
8477
- os: ubuntu-latest
85-
ghc: '8.10.7'
86-
test: true
87-
- os: windows-latest
88-
ghc: '9.4.4'
89-
test: true
90-
- os: windows-latest
91-
ghc: '9.2.5'
92-
test: true
93-
- os: windows-latest
94-
ghc: '9.0.2'
9578
test: true
9679
- os: windows-latest
97-
ghc: '8.10.7'
9880
test: true
9981

10082
steps:

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
{-# OPTIONS_GHC -Wno-orphans #-}
2222

23+
-- On 9.4 we get a new redundant constraint warning, but deleting the
24+
-- constraint breaks the build on earlier versions. Rather than apply
25+
-- lots of CPP, we just disable the warning until later.
26+
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
27+
2328
#ifdef HLINT_ON_GHC_LIB
2429
#define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc_lib_parser(x,y,z)
2530
#else
@@ -134,8 +139,11 @@ import Development.IDE.Spans.Pragmas (LineSplitTe
134139
lineSplitTextEdits,
135140
nextPragmaLine)
136141
import GHC.Generics (Generic)
142+
#if MIN_VERSION_apply_refact(0,12,0)
143+
#else
137144
import System.Environment (setEnv,
138145
unsetEnv)
146+
#endif
139147
import Text.Regex.TDFA.Text ()
140148
-- ---------------------------------------------------------------------
141149

0 commit comments

Comments
 (0)