Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show diff on failure in cabal-gild check action #857

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
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
19 changes: 12 additions & 7 deletions .github/workflows/check-cabal-gild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ 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"

Expand All @@ -33,8 +33,13 @@ jobs:
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
Loading