Skip to content

Commit dc55b04

Browse files
committed
Check generated Course*.hs files are up-to-date
1 parent 893f822 commit dc55b04

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
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/Course04.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ data Authenticated
125125
-- @type@ defines aliases (shortcuts)
126126
type UserWithAuthStatus a = User
127127

128-
authenticate' :: User -> String -> UserWithAuthStatus Authenticated
128+
authenticate' :: User -> String -> Either String (UserWithAuthStatus Authenticated)
129129
authenticate' = undefined
130130

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)