From 2bd30ac61cab9c66d6155ed1ed3e5f4dd0470444 Mon Sep 17 00:00:00 2001
From: Daniel Gröber <dxld@darkboxed.org>
Date: Mon, 18 Sep 2017 20:49:24 +0200
Subject: Extract CI config into scripts

---
 scripts/ci/steps/05-print-packages.sh |  1 +
 scripts/ci/steps/10-dependencies.sh   |  3 +++
 scripts/ci/steps/15-print-packages.sh |  1 +
 scripts/ci/steps/20-sdist.sh          | 10 ++++++++++
 scripts/ci/steps/30-build.sh          |  3 +++
 scripts/ci/steps/40-test.sh           |  1 +
 6 files changed, 19 insertions(+)
 create mode 120000 scripts/ci/steps/05-print-packages.sh
 create mode 100644 scripts/ci/steps/10-dependencies.sh
 create mode 120000 scripts/ci/steps/15-print-packages.sh
 create mode 100644 scripts/ci/steps/20-sdist.sh
 create mode 100644 scripts/ci/steps/30-build.sh
 create mode 100644 scripts/ci/steps/40-test.sh

(limited to 'scripts/ci/steps')

diff --git a/scripts/ci/steps/05-print-packages.sh b/scripts/ci/steps/05-print-packages.sh
new file mode 120000
index 0000000..4a3479a
--- /dev/null
+++ b/scripts/ci/steps/05-print-packages.sh
@@ -0,0 +1 @@
+../print-packages.sh
\ No newline at end of file
diff --git a/scripts/ci/steps/10-dependencies.sh b/scripts/ci/steps/10-dependencies.sh
new file mode 100644
index 0000000..c506bb8
--- /dev/null
+++ b/scripts/ci/steps/10-dependencies.sh
@@ -0,0 +1,3 @@
+cabal update
+cabal sandbox init
+cabal install --only-dependencies
diff --git a/scripts/ci/steps/15-print-packages.sh b/scripts/ci/steps/15-print-packages.sh
new file mode 120000
index 0000000..4a3479a
--- /dev/null
+++ b/scripts/ci/steps/15-print-packages.sh
@@ -0,0 +1 @@
+../print-packages.sh
\ No newline at end of file
diff --git a/scripts/ci/steps/20-sdist.sh b/scripts/ci/steps/20-sdist.sh
new file mode 100644
index 0000000..dd4554e
--- /dev/null
+++ b/scripts/ci/steps/20-sdist.sh
@@ -0,0 +1,10 @@
+source_dir="$(mktemp --tmpdir -d "cabal-helper.sdistXXXXXXXXX")"
+mkdir -p "$source_dir"
+
+cabal sdist --output-directory="$source_dir"
+
+if [ -e cabal.sandbox.config ]; then
+    cp cabal.sandbox.config "$source_dir"
+fi
+
+cd "$source_dir"
diff --git a/scripts/ci/steps/30-build.sh b/scripts/ci/steps/30-build.sh
new file mode 100644
index 0000000..1f5e2ef
--- /dev/null
+++ b/scripts/ci/steps/30-build.sh
@@ -0,0 +1,3 @@
+cabal configure --enable-tests
+cabal build
+cabal haddock
diff --git a/scripts/ci/steps/40-test.sh b/scripts/ci/steps/40-test.sh
new file mode 100644
index 0000000..ee15c1f
--- /dev/null
+++ b/scripts/ci/steps/40-test.sh
@@ -0,0 +1 @@
+cabal test --show-details=direct
-- 
cgit v1.2.3