Skip to content

Commit fee62e7

Browse files
authored
Merge pull request #5579 from commercialhaskell/cachebust
Cache bust and disable some Mac tests
2 parents a564828 + e4da4c0 commit fee62e7

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@ jobs:
2323
include:
2424
- os: ubuntu-latest
2525
release-args: "--alpine"
26+
cache-bust: ""
2627
- os: windows-latest
2728
release-args: ""
29+
cache-bust: ""
2830
- os: macos-latest
2931
release-args: ""
32+
cache-bust: "1"
3033
steps:
3134
- name: Clone project
3235
uses: actions/checkout@v2
3336
- name: Cache dependencies
3437
uses: actions/cache@v1
3538
with:
3639
path: ~/.stack
37-
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
40+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
3841
- shell: bash
3942
name: Install deps and run checks
4043
run: |

test/integration/lib/StackTest.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ exeExt = if isWindows then ".exe" else ""
252252
isWindows :: Bool
253253
isWindows = os == "mingw32"
254254

255+
isLinux :: Bool
256+
isLinux = os == "linux"
257+
255258
-- | Is the OS Alpine Linux?
256259
getIsAlpine :: IO Bool
257260
getIsAlpine = doesFileExist "/etc/alpine-release"

test/integration/tests/1336-1337-new-package-names/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ main :: IO ()
88
main =
99
if isWindows
1010
then logInfo "Disabled on Windows (see https://github.com/commercialhaskell/stack/issues/1337#issuecomment-166118678)"
11-
else do
11+
else when isLinux $ do
1212
safeNew "1234a-4b-b4-abc-12b34"
1313
doesExist "./1234a-4b-b4-abc-12b34/stack.yaml"
1414
stackErr ["new", "1234-abc"]

test/integration/tests/3850-cached-templates-network-errors/Main.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import StackTest
2-
import Control.Monad (unless)
2+
import Control.Monad (when, unless)
33
import Data.List (isInfixOf)
44
import Data.Maybe (fromMaybe)
55
import System.Directory
66
import System.Environment (lookupEnv, setEnv)
77
import System.FilePath
88

99
main :: IO ()
10-
main = do
10+
main = when isLinux $ do
1111
performCachingTest templateUrl
1212
performCachingTest githubTemplate
1313
where
@@ -19,7 +19,7 @@ main = do
1919
removeDirectoryRecursive "tmp"
2020
setEnv "HTTPS_PROXY" "http://sdsgsfgslfgsjflgkjs" -- make https requests fail
2121
stackCheckStderr arguments $ \stderr ->
22-
unless ("Using cached local version" `isInfixOf` stderr)
22+
unless ("Using cached local version" `isInfixOf` stderr)
2323
(error "stack didn't load the cached template")
2424

2525
removeDirectoryRecursive "tmp"
@@ -31,7 +31,7 @@ main = do
3131
templateUrl :: String
3232
templateUrl =
3333
"https://raw.githubusercontent.com/commercialhaskell/stack-templates/986836cc85b0c8c5bbb78d7b94347ba095089b03/tasty-discover.hsfiles"
34-
34+
3535
-- the same template, cached differently
3636
githubTemplate :: String
3737
githubTemplate = "github:commercialhaskell/tasty-discover.hsfiles"

test/integration/tests/git-submodules/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import System.Exit (exitFailure)
44
import System.FilePath ((</>))
55
import Data.List (filter)
66
import System.IO (hPutStrLn, withFile, IOMode(..))
7-
import Control.Monad (unless)
7+
import Control.Monad (when)
88

99
main :: IO ()
10-
main = unless isWindows $ do
10+
main = when isLinux $ do
1111
let
1212
gitInit = do
1313
runShell "git init ."

0 commit comments

Comments
 (0)