File tree Expand file tree Collapse file tree 6 files changed +15
-1
lines changed Expand file tree Collapse file tree 6 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ ghc-head: False
23
23
-- remove cabal noise from test output
24
24
-- cabal-noise: False
25
25
26
- -- Build tests. In addition to True and False you may specify
26
+ -- Build tests. Alternatively to True and False you may specify
27
27
-- a version range, e.g. >= 8.0 to build tests only in some jobs.
28
28
tests: True
29
29
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ data Auxiliary = Auxiliary
49
49
, anyJobUsesPreviewGHC :: Bool
50
50
, runHaddock :: Bool
51
51
, haddockFlags :: String
52
+ , runWeeder :: Bool
52
53
}
53
54
54
55
auxiliary :: Config -> Project URI Void Package -> JobVersions -> Auxiliary
@@ -84,6 +85,8 @@ auxiliary Config {..} prj JobVersions {..} = Auxiliary {..}
84
85
ComponentsAll -> " --haddock-all"
85
86
ComponentsLibs -> " "
86
87
88
+ runWeeder = not (equivVersionRanges C. noVersion cfgWeeder)
89
+
87
90
extraCabalProjectFields :: FilePath -> [C. PrettyField () ]
88
91
extraCabalProjectFields rootdir = buildList $ do
89
92
-- generate package fields for URI packages.
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ configGrammar = Config
90
90
^^^ metahelp " RANGE" " Haddock step"
91
91
<*> optionalFieldDef " haddock-components" (field @ " cfgHaddockComponents" ) defaultConfig
92
92
^^^ metahelp " all|libs" " Haddock components"
93
+ <*> rangeField " weeder" (field @ " cfgWeeder" ) defaultConfig
94
+ ^^^ metahelp " RANGE" " Weeder step"
93
95
<*> rangeField " no-tests-no-benchmarks" (field @ " cfgNoTestsNoBench" ) defaultConfig
94
96
^^^ metahelp " RANGE" " Build without tests and benchmarks"
95
97
<*> rangeField " unconstrained" (field @ " cfgUnconstrainted" ) defaultConfig
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ initialConfig = Config
37
37
, cfgBenchmarks = anyVersion
38
38
, cfgHaddock = anyVersion
39
39
, cfgHaddockComponents = ComponentsAll
40
+ , cfgWeeder = anyVersion
40
41
, cfgNoTestsNoBench = anyVersion
41
42
, cfgUnconstrainted = anyVersion
42
43
, cfgHeadHackage = defaultHeadHackage
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ data Config = Config
42
42
, cfgBenchmarks :: ! VersionRange
43
43
, cfgHaddock :: ! VersionRange
44
44
, cfgHaddockComponents :: ! Components
45
+ , cfgWeeder :: ! VersionRange
45
46
, cfgNoTestsNoBench :: ! VersionRange
46
47
, cfgUnconstrainted :: ! VersionRange
47
48
, cfgHeadHackage :: ! VersionRange
Original file line number Diff line number Diff line change @@ -536,6 +536,13 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
536
536
-- disable-documentation disables docs in deps: https://github.com/haskell/cabal/issues/7462
537
537
sh_if range $ " $CABAL v2-haddock --disable-documentation" ++ haddockFlags ++ " $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all"
538
538
539
+ when runWeeder $
540
+ for_ pkgs $ \ Pkg {pkgName} -> do
541
+ githubUses " weeder" " freckle/weeder-action@v2" $ buildList $ do
542
+ item (" ghc-version" , " ${{ matrix.compilerVersion }}" )
543
+ item (" weeder-arguments" , " --config $GITHUB_WORKSPACE/source/weeder.toml" )
544
+ item (" working-directory" , pkgNameDirVariable pkgName)
545
+
539
546
-- unconstrained build
540
547
unless (equivVersionRanges C. noVersion cfgUnconstrainted) $ githubRun " unconstrained build" $ do
541
548
let range = Range cfgUnconstrainted
You can’t perform that action at this time.
0 commit comments