Skip to content

Commit

Permalink
exclude non-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
konn committed Dec 27, 2023
1 parent ae40a10 commit c3cb37e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 45 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,3 @@ jobs:
echo "Executing: ${TEST}"
"${TEST}"
done
find artifacts/exes -type f | while read -r TEST; do
echo "Executing: ${TEST}"
"${TEST}"
done
80 changes: 40 additions & 40 deletions scripts/collect-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,52 @@ set +x

echo "[*] Setting-up cabal-plan"
if command -v cabal-plan; then
echo "cabal-plan found."
CABAL_PLAN="$(command -v cabal-plan)"
echo "cabal-plan found."
CABAL_PLAN="$(command -v cabal-plan)"
else
echo "No cabal-plan found."
set -x
case "$(uname)" in
Darwin)
CABAL_PLAN_URL=https://github.com/konn/cabal-plan/releases/download/v0.7.2.3/cabal-plan-0.7.2.3-macOS-x86_64.xz
;;
*)
CABAL_PLAN_URL=https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz
;;
esac

wget "${CABAL_PLAN_URL}" -O cabal-plan.xz

xz -d <./cabal-plan.xz >cabal-plan
chmod +x cabal-plan
set +x
CABAL_PLAN="$(pwd)/cabal-plan"
echo "No cabal-plan found."
set -x
case "$(uname)" in
Darwin)
CABAL_PLAN_URL=https://github.com/konn/cabal-plan/releases/download/v0.7.2.3/cabal-plan-0.7.2.3-macOS-x86_64.xz
;;
*)
CABAL_PLAN_URL=https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz
;;
esac
wget "${CABAL_PLAN_URL}" -O cabal-plan.xz
xz -d <./cabal-plan.xz >cabal-plan
chmod +x cabal-plan
set +x
CABAL_PLAN="$(pwd)/cabal-plan"
fi

echo "[*] Places artifacts into the correct place"

set -x
${CABAL_PLAN} list-bins | grep -v tasty | while read -r TARG; do
COMPONENT=$(echo "${TARG}" | awk '{ print $1 }')
BIN=$(echo "${TARG}" | awk '{ print $2 }')
TYPE=$(echo "${COMPONENT}" | cut -d':' -f2)
echo "---"
echo "- Comp: ${COMPONENT}"
echo "- Path: ${BIN}"
echo "- TYPE: ${TYPE}"
case "${TYPE}" in
exe)
COPY_DEST=${EXES}
;;
test)
COPY_DEST=${TESTS}
;;
*)
COPY_DEST=${BENCHS}
;;
esac
echo "Copying to ${COPY_DEST}"
cp "${BIN}" "${COPY_DEST}/"
${CABAL_PLAN} list-bins | grep -v hsc2hs | grep -v tasty | while read -r TARG; do
COMPONENT=$(echo "${TARG}" | awk '{ print $1 }')
BIN=$(echo "${TARG}" | awk '{ print $2 }')
TYPE=$(echo "${COMPONENT}" | cut -d':' -f2)
echo "---"
echo "- Comp: ${COMPONENT}"
echo "- Path: ${BIN}"
echo "- TYPE: ${TYPE}"
case "${TYPE}" in
exe)
COPY_DEST=${EXES}
;;
test)
COPY_DEST=${TESTS}
;;
*)
COPY_DEST=${BENCHS}
;;
esac
echo "Copying to ${COPY_DEST}"
cp "${BIN}" "${COPY_DEST}/"
done

tar --use-compress-program="zstdmt -8" -caf "${DEST}.tar.zst" "./${1}"

0 comments on commit c3cb37e

Please sign in to comment.