Skip to content

Commit

Permalink
ok, go!
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdone committed Sep 3, 2024
1 parent 5075cb8 commit fc5c6fe
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:

on:
push:
branches: [ "main" ]
branches: [ "main", "cd/2024-09-03-gen-docs" ]
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -41,4 +41,6 @@ jobs:
- run: |
cd /tmp/hell && stack build --fast
- run: |
cd /tmp/hell && stack exec hell scripts/check.hell
cd /tmp/hell && stack exec hell scripts/check-examples.hell
- run: |
cd /tmp/hell && stack exec hell scripts/check-docs.hell
7 changes: 7 additions & 0 deletions scripts/check-docs.hell
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
main = do
Text.putStrLn "Checking docs are up to date ..."
Directory.copyFile "docs/api/index.html" "docs/api/index.html-prev"
Process.runProcess_ $ Process.proc "hell" ["scripts/gen-docs.hell"]
Process.runProcess_ $
Process.proc "diff" ["docs/api/index.html", "docs/api/index.html-prev", "-q"]
Text.putStrLn "Docs are up to date."
10 changes: 10 additions & 0 deletions scripts/check-examples.hell
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
main = do
examples <- Directory.listDirectory "examples/"
let check = \fp -> do
Text.putStrLn $ Text.concat ["Checking ", fp]
Process.runProcess_ (Process.proc "hell" ["--check", fp])
Monad.forM_ examples \example -> do
check $ Text.concat ["examples/", example]
check "scripts/static-build.hell"
check "scripts/install-hell.hell"
Text.putStrLn "All OK."
3 changes: 0 additions & 3 deletions scripts/gen-docs.ghci

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/gen-docs.hell
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
main = do
Text.putStrLn "Generating docs ..."
let script = Text.unlines [":l src/Hell.hs", "_generateApiDocs", ":quit"]
_out <- ByteString.readProcess_
(Text.setStdin script
(Process.proc "stack" ["ghci","--no-load"]))
Text.putStrLn "Generated docs."

0 comments on commit fc5c6fe

Please sign in to comment.