Make cabal-cache non-fatal
This commit is contained in:
parent
055df584a4
commit
422b99a222
20
.github/scripts/cabal-cache.sh
vendored
Normal file
20
.github/scripts/cabal-cache.sh
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
case "$(uname -s)" in
|
||||
MSYS_*|MINGW*)
|
||||
ext=".exe"
|
||||
;;
|
||||
*)
|
||||
ext=""
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${CABAL_CACHE_DISABLE}" = "yes" ] ; then
|
||||
echo "cabal-cache disabled (CABAL_CACHE_DISABLE set)"
|
||||
elif [ "${CABAL_CACHE_NONFATAL}" = "yes" ] ; then
|
||||
time "cabal-cache${ext}" "$@" || echo "cabal-cache failed (CABAL_CACHE_NONFATAL set)"
|
||||
else
|
||||
time "cabal-cache${ext}" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
8
.github/scripts/common.sh
vendored
8
.github/scripts/common.sh
vendored
@ -15,7 +15,7 @@ sync_from() {
|
||||
cabal_store_path="$(dirname "$(cabal help user-config | tail -n 1 | xargs)")/store"
|
||||
fi
|
||||
|
||||
cabal-cache sync-from-archive \
|
||||
cabal-cache.sh sync-from-archive \
|
||||
--host-name-override=${S3_HOST} \
|
||||
--host-port-override=443 \
|
||||
--host-ssl-override=True \
|
||||
@ -29,7 +29,7 @@ sync_to() {
|
||||
cabal_store_path="$(dirname "$(cabal help user-config | tail -n 1 | xargs)")/store"
|
||||
fi
|
||||
|
||||
cabal-cache sync-to-archive \
|
||||
cabal-cache.sh sync-to-archive \
|
||||
--host-name-override=${S3_HOST} \
|
||||
--host-port-override=443 \
|
||||
--host-ssl-override=True \
|
||||
@ -115,6 +115,10 @@ download_cabal_cache() {
|
||||
mv "cabal-cache${exe}" "${dest}${exe}"
|
||||
chmod +x "${dest}${exe}"
|
||||
fi
|
||||
|
||||
# install shell wrapper
|
||||
cp "${CI_PROJECT_DIR}"/.github/scripts/cabal-cache.sh "$HOME"/.local/bin/
|
||||
chmod +x "$HOME"/.local/bin/cabal-cache.sh
|
||||
)
|
||||
}
|
||||
|
||||
|
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
@ -12,6 +12,10 @@ on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
|
||||
env:
|
||||
CABAL_CACHE_DISABLE: ${{ vars.CABAL_CACHE_DISABLE }}
|
||||
CABAL_CACHE_NONFATAL: yes
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
name: Build linux binary
|
||||
|
Loading…
Reference in New Issue
Block a user