Skip to content

Commit

Permalink
Merge pull request #857 from IntersectMBO/fix-cabal-gild-issues
Browse files Browse the repository at this point in the history
Show diff on failure in cabal-gild check action
  • Loading branch information
palas authored Aug 5, 2024
2 parents 49c29fc + 3462e0f commit 0e2afa6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/check-cabal-gild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,37 @@ jobs:
runs-on: ubuntu-latest

env:
CARDANO_GUILD_VERSION: "1.3.1.2"
CABAL_GILD_VERSION: "1.3.1.2"

steps:
- name: Download cardano-gild
- name: Download cabal-gild
run: |
cardano_gild_path="$(mktemp -d)"
version="${{env.CARDANO_GUILD_VERSION}}"
cabal_gild_path="$(mktemp -d)"
version="${{env.CABAL_GILD_VERSION}}"
curl -sL \
"https://github.com/tfausak/cabal-gild/releases/download/$version/cabal-gild-$version-linux-x64.tar.gz" \
| tar -C "$cardano_gild_path" -xz
| tar -C "$cabal_gild_path" -xz
echo "PATH=$cardano_gild_path:$PATH" >> "$GITHUB_ENV"
echo "PATH=$cabal_gild_path:$PATH" >> "$GITHUB_ENV"
- uses: actions/checkout@v4

- name: Run cardano-gild over all modified files
- name: Run cabal-gild over all modified files
run: |
rc="0"
echo "cabal-gild version: ${{env.CABAL_GILD_VERSION}}"
for file in $(git ls-files "*.cabal")
do
echo "cabal-gild --mode=check --input=$file"
if ! cabal-gild --mode=check --input="$file"
then
cabal-gild --mode=format --io="$file"
echo "💣 $file is badly formatted. Fix it with:"
echo "cabal-gild --mode=format --io=$file"
echo -e
echo "Diff for $file:"
git diff "$file"
echo -e
rc="1"
fi
done
Expand Down

0 comments on commit 0e2afa6

Please sign in to comment.