aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/build.sh9
-rw-r--r--scripts/ci/print-packages.sh5
l---------scripts/ci/steps/05-print-packages.sh1
-rw-r--r--scripts/ci/steps/10-dependencies.sh3
l---------scripts/ci/steps/15-print-packages.sh1
-rw-r--r--scripts/ci/steps/20-sdist.sh10
-rw-r--r--scripts/ci/steps/30-build.sh3
-rw-r--r--scripts/ci/steps/40-test.sh1
8 files changed, 33 insertions, 0 deletions
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
new file mode 100755
index 0000000..7d2c136
--- /dev/null
+++ b/scripts/ci/build.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -ex
+
+CI_SCRIPTS_DIR="$(realpath "$(dirname "$0")")"
+
+for step in $(printf '%s\n' "$CI_SCRIPTS_DIR"/steps/* | sort); do
+ . $step
+done
diff --git a/scripts/ci/print-packages.sh b/scripts/ci/print-packages.sh
new file mode 100644
index 0000000..891cea6
--- /dev/null
+++ b/scripts/ci/print-packages.sh
@@ -0,0 +1,5 @@
+if [ -e cabal.sandbox.config ]; then
+ cabal sandbox hc-pkg list
+else
+ ghc-pkg list
+fi
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