Skip to content

Commit 9e00122

Browse files
committed
Check generated Course*.hs files are up-to-date
1 parent bf49130 commit 9e00122

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/haskell.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
git clone https://github.com/smelc/exdown
2929
EXDOWN=exdown/exdown.py ./extract_hs.sh
3030
31+
- name: Check versioned Course*.hs files are up to date
32+
working-directory: slides
33+
run: |
34+
./check_golden_diff.sh
35+
3136
- name: Set up GHC ${{ matrix.ghc-version }}
3237
uses: haskell-actions/setup@v2
3338
id: setup

slides/check_golden_diff.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Verify that Course*.hs files do not have git modification.
4+
# Probably you want to execute this file after 'extract_hs.sh'
5+
6+
for file in Course*.hs
7+
do
8+
# Check if there is any modification to file
9+
if ! git diff --exit-code "$file"
10+
then
11+
echo "$file is modified. Please run extract_hs.sh and commit the changes."
12+
exit 1
13+
fi
14+
done

0 commit comments

Comments
 (0)