Commit 28c89507d1b9e1013e690adc1ef16f30bd3fa4f5

Edward Thomson 2017-11-06T11:49:46

Merge pull request #4394 from libgit2/cmn/macos-ramdisk travis: put clar's sandbox in a ramdisk on macOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/script/cibuild.sh b/script/cibuild.sh
index 74946db..1c28baa 100755
--- a/script/cibuild.sh
+++ b/script/cibuild.sh
@@ -10,6 +10,15 @@ fi
 
 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
 	export PKG_CONFIG_PATH=$(ls -d /usr/local/Cellar/{curl,zlib}/*/lib/pkgconfig | paste -s -d':' -)
+
+	# Set up a ramdisk for us to put our test data on to speed up tests on macOS
+	export CLAR_TMP="$HOME"/_clar_tmp
+	mkdir -p $CLAR_TMP
+
+	# 5*2M sectors aka ~5GB of space
+	device=$(hdiutil attach -nomount ram://$((5 * 2 * 1024 * 1024)))
+	newfs_hfs $device
+	mount -t hfs $device $CLAR_TMP
 fi
 
 # Should we ask Travis to cache this file?