@@ -101,9 +101,9 @@ makeGitHub
101
101
-> Either HsCiError GitHub
102
102
makeGitHub _argv config@ Config {.. } gitconfig prj jobs@ JobVersions {.. } = do
103
103
let envEnv = Map. fromList
104
- [ (" HCNAME" , " ${{ matrix.compiler }} " ) -- e.g. ghc-8.8.4
105
- , (" HCKIND" , " ${{ matrix.compilerKind }} " ) -- ghc
106
- , (" HCVER" , " ${{ matrix.compilerVersion }} " ) -- 8.8.4
104
+ [ (" HCNAME" , ghWrapExpr " matrix.compiler" ) -- e.g. ghc-8.8.4
105
+ , (" HCKIND" , ghWrapExpr " matrix.compilerKind" ) -- ghc
106
+ , (" HCVER" , ghWrapExpr " matrix.compilerVersion" ) -- 8.8.4
107
107
]
108
108
109
109
-- Validity checks
@@ -536,6 +536,15 @@ 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
+ let range = RangeGHC /\ Range cfgWeeder in
541
+ let ifCond = ghCompilerVersionArithPredicate allVersions range in
542
+ for_ pkgs $ \ Pkg {pkgName} -> do
543
+ githubUsesIf " weeder" " freckle/weeder-action@v2" ifCond $ buildList $ do
544
+ item (" ghc-version" , ghWrapExpr " matrix.compilerVersion" )
545
+ item (" weeder-arguments" , " --config $GITHUB_WORKSPACE/source/weeder.toml" )
546
+ item (" working-directory" , ghWrapExpr $ ghEnvContext $ pkgNameDirVariable' pkgName)
547
+
539
548
-- unconstrained build
540
549
unless (equivVersionRanges C. noVersion cfgUnconstrainted) $ githubRun " unconstrained build" $ do
541
550
let range = Range cfgUnconstrainted
@@ -590,7 +599,7 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
590
599
, ghjSteps = steps
591
600
, ghjIf = Nothing
592
601
, ghjContainer = Just $ " buildpack-deps:" ++ ubuntuVer
593
- , ghjContinueOnError = Just " ${{ matrix.allow-failure }} "
602
+ , ghjContinueOnError = Just $ ghWrapExpr " matrix.allow-failure"
594
603
, ghjServices = mconcat
595
604
[ Map. singleton " postgres" postgresService | cfgPostgres ]
596
605
, ghjTimeout = max 10 cfgTimeoutMinutes
@@ -764,10 +773,10 @@ ircJob actionName mainJobName projectName cfg gitconfig = item ("irc", GitHubJob
764
773
, Just repo <- parseGitHubRepo url
765
774
766
775
= Just
767
- $ " ${{ always() && (github.repository == '" ++ T. unpack repo ++ " ') }} "
776
+ $ ghWrapExpr " always() && (github.repository == '" ++ T. unpack repo ++ " ')"
768
777
769
778
| otherwise
770
- = Just " ${{ always() }} "
779
+ = Just $ ghWrapExpr " always()"
771
780
-- Use always() above to ensure that the IRC job will still run even if
772
781
-- the build job itself fails (see #437).
773
782
@@ -855,3 +864,13 @@ parseGitHubRepo t =
855
864
-- runners support.
856
865
ghcRunsOnVer :: String
857
866
ghcRunsOnVer = " ubuntu-20.04"
867
+
868
+ ghWrapExpr :: String -> String
869
+ ghWrapExpr expr = " ${{ " ++ expr ++ " }}"
870
+
871
+ ghEnvContext :: String -> String
872
+ ghEnvContext = (" env." ++ )
873
+
874
+ ghCompilerVersionArithPredicate :: Set CompilerVersion -> CompilerRange -> String
875
+ ghCompilerVersionArithPredicate = compilerVersionPredicateImpl $
876
+ freeToArith $ ExprConfig ghWrapExpr ghEnvContext
0 commit comments