diff --git a/.github/workflows/backblaze.yml b/.github/workflows/backblaze.yml.disable similarity index 100% rename from .github/workflows/backblaze.yml rename to .github/workflows/backblaze.yml.disable diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0a7f61..eda2b7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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+ @@ -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: diff --git a/app/App/Static.hs b/app/App/Static.hs index 73fb739..8143f10 100644 --- a/app/App/Static.hs +++ b/app/App/Static.hs @@ -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) diff --git a/test/HaskellWorks/CabalCache/AwsSpec.hs b/test/HaskellWorks/CabalCache/AwsSpec.hs index 63232b4..cd88ee2 100644 --- a/test/HaskellWorks/CabalCache/AwsSpec.hs +++ b/test/HaskellWorks/CabalCache/AwsSpec.hs @@ -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)