Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ endgroup
jsoref
Linting
mktemp
tarball
workflows
XDG
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ inputs:
dhall-file-list:
description: 'Null delimited file of dhall files to check'
required: false
dhall-cache-url:
description: 'Dhall cache tarball'
required: false
parallel-jobs:
description: 'Number of CPUs available for running checks'
required: false
Expand All @@ -47,6 +50,7 @@ runs:
steps:
- shell: bash
env:
DHALL_CACHE_URL: ${{ inputs.dhall-cache-url }}
DHALL_HASKELL: ${{ inputs.dhall-haskell }}
DHALL_HASKELL_BINARY: ${{ inputs.dhall-haskell-binary }}
DHALL_JSON: ${{ inputs.dhall-json }}
Expand Down
27 changes: 27 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh -e
if [ -n "$VERBOSE" ]; then
set -x
fi

dhall_json="$(eval echo "$DHALL_JSON_BINARY")"
dhall_haskell="$(eval echo "$DHALL_HASKELL_BINARY")"
Expand All @@ -17,6 +20,30 @@ PATH="$dhall_haskell_extracted/bin:$PATH"

echo "::add-matcher::$GITHUB_ACTION_PATH/dhall-checker.json"

if [ -z "$XDG_CACHE_HOME" ]; then
export XDG_CACHE_HOME=/tmp/dhall-cache
mkdir -p "$XDG_CACHE_HOME"
echo "XDG_CACHE_HOME=$XDG_CACHE_HOME" >> "$GITHUB_ENV"
fi

if [ -n "$DHALL_CACHE_URL" ]; then
dhall_cache=$(mktemp)
curl -sSL "$DHALL_CACHE_URL" -o "$dhall_cache"
(
cd "$XDG_CACHE_HOME"
tar xf "$dhall_cache"
root_items="$(
tar tf "$dhall_cache" |
perl -pe 's!/.*!!' |
uniq
)"
if [ $(echo "$root_items" | wc -l) = 1 ] ; then
mv "$root_items"/* .
rmdir "$root_items"
fi
)
fi

export DHALL_FAILURES=$(mktemp -d)
if [ -z "$LIST" ]; then
export LIST=$(mktemp)
Expand Down
Loading