Skip to content

Commit

Permalink
Fix CI and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Nov 24, 2024
1 parent e497241 commit 4610fe4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
File renamed without changes.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
ghc: ["9.6.6", "9.4.8", "9.2.8"]
os: [ubuntu-latest, windows-latest]
include:
- ghc: "8.10.7"
- ghc: "9.6.6"
os: macOS-latest

steps:
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v2
- uses: haskell/actions-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand All @@ -36,6 +36,15 @@ jobs:
if: matrix.os == 'windows-latest'
run: echo 'EXE_EXT=.exe' >> $GITHUB_ENV

- name: Setup environment
run: |
export CABAL_STORE="${{ steps.setup-haskell.outputs.cabal-store }}"
export CABAL_DIR="$(dirname $CABAL_STORE)"
echo 'CABAL_CACHE_CABAL_DIR=$CABAL_CACHE_CABAL_DIR' >> $GITHUB_ENV
- name: Cabal update
run: cabal update

- name: Configure project
run: |
cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+
Expand Down Expand Up @@ -229,7 +238,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7"]
ghc: ["9.6.6"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
9 changes: 6 additions & 3 deletions app/App/Static.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ import qualified App.Static.Base as S
import qualified App.Static.Posix as P
import qualified App.Static.Windows as W
import qualified Cabal.Config as CC
import qualified System.Environment as IO
import qualified System.IO.Unsafe as IO


{-# NOINLINE cabalStoreDirectory #-}
cabalStoreDirectory :: FilePath
cabalStoreDirectory = IO.unsafePerformIO $ handle' $
runIdentity . CC.cfgStoreDir <$> CC.readConfig
cabalStoreDirectory = IO.unsafePerformIO $
IO.lookupEnv "CABAL_CACHE_CABAL_DIR" >>= \case
Just dir -> pure dir
Nothing ->
handle' $ runIdentity . CC.cfgStoreDir <$> CC.readConfig
where
handle' = handle (\(_ :: IOException) -> return $ if S.isPosix then P.cabalDirectory else W.cabalDirectory)

Expand Down
2 changes: 1 addition & 1 deletion test/HaskellWorks/CabalCache/AwsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec = describe "HaskellWorks.CabalCache.QuerySpec" do
ci <- liftIO $ IO.lookupEnv "CI" <&> isJust
unless ci do
envAws <- liftIO $ AWS.mkEnv AWS.Oregon (const LBSC.putStrLn)
let Just uri = URI.parseURI "s3://jky-mayhem/hjddhd"
let Just uri = URI.parseURI "s3://cache.haskellworks.io/hjddhd"
result :: Either (OO.Variant '[AwsError, UnsupportedUri]) ()
<- liftIO $ runExceptT $ OO.suspend AWS.runResourceT $ void (AWS.headS3Uri envAws uri)

Expand Down

0 comments on commit 4610fe4

Please sign in to comment.