diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d318d499..267811be 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04, macOS-12, windows-2022] - cabal: ["3.8.1.0"] + cabal: ["3.10.3.0"] ghc: - "8.6.5" - "8.8.4" @@ -21,7 +21,8 @@ jobs: - "9.0.2" - "9.2.8" - "9.4.8" - - "9.6.3" + - "9.6.5" + - "9.8.2" exclude: # fails to build: "can't load framework: Cocoa (not found)" - os: macOS-12 @@ -31,10 +32,10 @@ jobs: ghc: "8.8.4" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 id: setup-haskell-cabal name: Setup Haskell with: @@ -55,7 +56,7 @@ jobs: # avoid invalidating cache too often. sed '/^index-state: /d' cabal.project.freeze > dependencies-versions - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Cache ~/.cabal/store with: path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} @@ -75,20 +76,20 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - stack: ["2.9.3"] - ghc: ["9.4.5"] # We want this to match the Stackage snapshot in stack.yaml + stack: ["2.15.5"] + ghc: ["9.4.8"] # We want this to match the Stackage snapshot in stack.yaml steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 name: Setup Haskell Stack with: ghc-version: ${{ matrix.ghc }} stack-version: ${{ matrix.stack }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Cache ~/.stack with: path: ~/.stack @@ -111,10 +112,10 @@ jobs: ghc: ["9.2.8"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 id: setup-haskell-cabal name: Setup Haskell with: @@ -128,7 +129,7 @@ jobs: # avoid invalidating cache too often. sed '/^index-state: /d' cabal.project.freeze > dependencies-versions - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Cache ~/.cabal/store with: path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} @@ -141,8 +142,8 @@ jobs: - name: Unpack Cabal package run: | cd dist-newstyle/sdist - tar xvf *.tar.gz - rm -f *.tar.gz + tar xvf ./*.tar.gz + rm -f ./*.tar.gz - name: Build run: | diff --git a/hakyll.cabal b/hakyll.cabal index 85c0e45e..42818381 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -192,7 +192,7 @@ Library blaze-html >= 0.5 && < 0.10, blaze-markup >= 0.5.1 && < 0.9, bytestring >= 0.9 && < 0.13, - containers >= 0.3 && < 0.7, + containers >= 0.3 && < 0.8, data-default >= 0.4 && < 0.8, deepseq >= 1.3 && < 1.6, directory >= 1.2.7.0 && < 1.4, @@ -212,7 +212,7 @@ Library tagsoup >= 0.13.1 && < 0.15, template-haskell >= 2.14 && < 2.22, text >= 0.11 && < 1.3 || >= 2.0 && < 2.2, - time >= 1.8 && < 1.13, + time >= 1.8 && < 1.15, time-locale-compat >= 0.1 && < 0.2, unordered-containers >= 0.2 && < 0.3, vector >= 0.11 && < 0.14, @@ -286,7 +286,7 @@ Test-suite hakyll-tests Build-Depends: hakyll, - QuickCheck >= 2.8 && < 2.15, + QuickCheck >= 2.8 && < 2.16, tasty >= 0.11 && < 1.6, tasty-golden >= 2.3 && < 2.4, tasty-hunit >= 0.9 && < 0.11, @@ -295,7 +295,7 @@ Test-suite hakyll-tests aeson >= 1.0 && < 1.6 || >= 2.0 && < 2.3, base >= 4.12 && < 5, bytestring >= 0.9 && < 0.13, - containers >= 0.3 && < 0.7, + containers >= 0.3 && < 0.8, filepath >= 1.0 && < 1.6, tagsoup >= 0.13.1 && < 0.15, text >= 0.11 && < 1.3 || >= 2.0 && < 2.2, diff --git a/lib/Hakyll/Check.hs b/lib/Hakyll/Check.hs index dc72b87e..4edb00dd 100644 --- a/lib/Hakyll/Check.hs +++ b/lib/Hakyll/Check.hs @@ -248,7 +248,9 @@ checkExternalUrl url = do -- Convert exception to a concise form showException e = case cast e of Just (Http.HttpExceptionRequest _ e') -> show e' - _ -> head $ words $ show e + _ -> case words $ show e of + w:_ -> w + [] -> error "Hakyll.Check.checkExternalUrl: impossible" requestExternalUrl :: URL -> Checker (Either SomeException Bool) requestExternalUrl url = liftIO $ try $ do diff --git a/stack.yaml b/stack.yaml index f183426f..1a3a58b5 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: 'lts-21.6' # If you change this, please update GHC version "stack / ghc" job in .github/workflows/main.yaml +resolver: 'lts-21.25' # If you change this, please update GHC version "stack / ghc" job in .github/workflows/main.yaml save-hackage-creds: false system-ghc: true skip-ghc-check: true diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs index f31344dd..973f9d7b 100644 --- a/tests/Hakyll/Core/Runtime/Tests.hs +++ b/tests/Hakyll/Core/Runtime/Tests.hs @@ -78,7 +78,7 @@ case01 = do lines example @?= ["

This is an example.

"] bodies <- readFile $ destinationDirectory testConfiguration "bodies.txt" - head (lines bodies) @?= "This is an example." + head' (lines bodies) @?= "This is an example." partial <- readFile $ providerDirectory testConfiguration "partial.html.out" partial' <- readFile $ destinationDirectory testConfiguration "partial.html.out" @@ -86,6 +86,10 @@ case01 = do cleanTestEnv + where + head' (x:_) = x + head' [] = error "Hakyll.Core.Runtime.Tests.case01: impossible" + -------------------------------------------------------------------------------- case02 :: Assertion