Skip to content

Commit 0dd9304

Browse files
authored
Merge pull request #30 from gelisam/gelisam/check-hackage-matrix
check for hackage matrix failures in CI
2 parents 9a693da + 2af2311 commit 0dd9304

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Hackage Matrix
2+
3+
on:
4+
# Run once a month, to detect build failures reported on matrix.hackage.haskell.org
5+
schedule:
6+
- cron: '0 0 1 * *'
7+
8+
# To test this GitHub Action, uncomment this block and open a PR; then comment
9+
# it out again before merging the PR.
10+
#pull_request:
11+
# types: [opened, synchronize]
12+
13+
jobs:
14+
check-hackage-matrix:
15+
name: Check Hackage Matrix
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Download Report
20+
run: |
21+
PACKAGE_NAME="typelevel-rewrite-rules"
22+
23+
echo "checking https://matrix.hackage.haskell.org/#/package/$PACKAGE_NAME/ for failures..."
24+
REPORTS="$(curl https://matrix.hackage.haskell.org/api/v2/packages/$PACKAGE_NAME/reports)"
25+
REPORT_ID="$(echo "$REPORTS" | tr -d '[]' | tr ',' '\n' | tail -n 1)"
26+
REPORT="$(curl "https://matrix.hackage.haskell.org/api/v2/packages/$PACKAGE_NAME/reports/$REPORT_ID")"
27+
if echo "$REPORT" | grep '"bfail"' > /dev/null; then
28+
echo "Build failures are reported on https://matrix.hackage.haskell.org/#/package/$PACKAGE_NAME/" 1>&2
29+
false
30+
else
31+
echo "All good."
32+
true
33+
fi

0 commit comments

Comments
 (0)