Skip to content

Commit

Permalink
Test that docs.to-html actually writes files
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Jun 24, 2024
1 parent f4f55b9 commit 3a9e8e5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ jobs:
${{env.transcripts}}
# Fail if any transcripts cause git diffs.
git diff --ignore-cr-at-eol --exit-code unison-src/transcripts
- name: docs.to-html
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
run: |
${{env.ucm}} transcript unison-src/transcripts-manual/docs.to-html.md
# Fail if the output or generated docs differ.
git diff --ignore-cr-at-eol --exit-code \
unison-src/transcripts-manual/docs.to-html.output.md \
unison-src/transcripts-manual/docs.to-html
- name: mark transcripts as passing
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -417,7 +425,7 @@ jobs:
build-jit-binary:
name: build jit binary
needs: generate-jit-source
uses: ./.github/workflows/ci-build-jit-binary.yaml
uses: ./.github/workflows/ci-build-jit-binary.yaml

test-jit:
name: test jit
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-transcripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
stack exec unison transcript unison-src/transcripts-manual/rewrites.md
- name: transcripts
run: stack exec transcripts
- name: docs.to-html
run: |
stack exec unison transcript unison-src/transcripts-manual/docs.to-html.md
- name: save transcript changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
1 change: 1 addition & 0 deletions scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ true \
&& stack exec transcripts \
&& stack exec unison transcript unison-src/transcripts-round-trip/main.md \
&& stack exec unison transcript unison-src/transcripts-manual/rewrites.md \
&& stack exec unison transcript unison-src/transcripts-manual/docs.to-html.md \
&& stack exec cli-integration-tests
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
```ucm
.> project.create test-4402
test-4402/main> builtins.merge
.> project.create test-html-docs
test-html-docs/main> builtins.merge
```

```unison
Expand All @@ -15,6 +15,6 @@ some.outside = 3
```

```ucm
test-4402/main> add
test-4402/main> docs.to-html some.ns /tmp/test-4402
test-html-docs/main> add
test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
```ucm
.> project.create test-4402
.> project.create test-html-docs
🎉 I've created the project test-4402.
🎉 I've created the project test-html-docs.
I'll now fetch the latest version of the base Unison
library...
Expand All @@ -20,7 +20,7 @@
🎉 🥳 Happy coding!
test-4402/main> builtins.merge
test-html-docs/main> builtins.merge
Done.
Expand Down Expand Up @@ -57,7 +57,7 @@ some.outside = 3
```
```ucm
test-4402/main> add
test-html-docs/main> add
⍟ I've added these definitions:
Expand All @@ -70,6 +70,6 @@ test-4402/main> add
(also named lib.base.data.Map.internal.delta)
some.outside.doc : Doc
test-4402/main> docs.to-html some.ns /tmp/test-4402
test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html
```
1 change: 1 addition & 0 deletions unison-src/transcripts-manual/docs.to-html/direct/doc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<article class="unison-doc"><span class="span"><span class="word">A doc directly in the namespace.</span></span><div class="tooltips" style="display: none;"></div></article>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<article class="unison-doc"><span class="span"><span class="word">A doc pretty deeply nested in the namespace.</span></span><div class="tooltips" style="display: none;"></div></article>

0 comments on commit 3a9e8e5

Please sign in to comment.