Skip to content

Commit e717d56

Browse files
authored
Use a script to check cabal files in GH actions (#1346)
# Description I've noticed that the GH actions workflow step that runs `cabal check` inlines the script we have in `./scripts`. This PR calls the script and also modifies it to exit on the first `cabal check` failure.
2 parents c0564af + 92f054f commit e717d56

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,7 @@ jobs:
5656
- uses: actions/checkout@v4
5757

5858
- name: Cabal check
59-
run: |
60-
for x in $(find . -name '*.cabal' | grep -vE 'dist-newstyle|asserts\.cabal' | cut -c 3-); do
61-
(
62-
d=$(dirname $x)
63-
echo "== $d =="
64-
cd $d
65-
cabal check
66-
)
67-
done
59+
run: ./scripts/ci/check-cabal-files.sh
6860

6961
check-release-badges:
7062

scripts/ci/check-cabal-files.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -Eeuo pipefail
4+
35
for x in $(find . -name '*.cabal' | grep -vE 'dist-newstyle|asserts\.cabal' | cut -c 3-); do
46
(
57
d=$(dirname $x)

0 commit comments

Comments
 (0)