Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework racket based runtime/compilation #4675

Merged
merged 188 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
0540351
Further work on compilation to standalone executables
dolio Jan 16, 2024
f78c119
Revise how native compilation works
dolio Feb 5, 2024
958b8b9
Rename runner, add docs, delete dead code
dolio Feb 5, 2024
2e98e1a
Add a transcript to create generated racket libs
dolio Feb 6, 2024
c3c62c4
Give a nicer looking error for ucr/raco problems
dolio Feb 6, 2024
72743c5
Eliminate commented dead code
dolio Feb 6, 2024
788e082
Add an improved error message for unison native runtime failure
dolio Feb 7, 2024
7ce4ad2
Add information on further building to gen-racket-libs.md
dolio Feb 7, 2024
a678f55
Actually make run.native use the standalone runner
dolio Feb 7, 2024
5f946e2
Merge remote-tracking branch 'origin/trunk' into topic/native-compiler
dolio Feb 7, 2024
6703193
Rename ucr to unison-runtime
dolio Feb 8, 2024
9a253e8
Add info file for unison racket package
dolio Feb 8, 2024
038550c
Native runtime location argument, and an improved error msg
dolio Feb 9, 2024
b3cad2c
refactor ci.yaml with jit setup steps (attempt 1)
Feb 12, 2024
61d63a6
yaml
Feb 12, 2024
221ebb8
unyaml
Feb 12, 2024
eb845f1
yaml home
Feb 12, 2024
296333d
yaml unhome
Feb 12, 2024
f96d8ce
yaml move env
Feb 12, 2024
cf91e87
yaml matrix
Feb 12, 2024
5dde584
yaml can't define vars in terms of vars
Feb 12, 2024
9ff8d76
yaml quotes sometimes
Feb 12, 2024
7e0bdaf
yaml renamed var
Feb 12, 2024
27acbd4
yaml need env namespace
Feb 12, 2024
d46159c
yaml broken variables hack
Feb 12, 2024
5d4ab9f
yaml hack documentation
Feb 12, 2024
7711915
yaml job steps
Feb 12, 2024
3aa7fd9
yaml tweak identifier?
Feb 12, 2024
18bfab6
yaml that didn't work
Feb 12, 2024
62cd734
yaml bump plugins to node 20
Feb 12, 2024
7b53c51
Modify transcript runner to allow runtime path
dolio Feb 12, 2024
c61fe2e
Merge remote-tracking branch 'origin/topic/native-compiler' into topi…
dolio Feb 12, 2024
9905eb8
Fix ucm tests w/r/t/ previous additions
dolio Feb 12, 2024
0cf6222
yaml can't evaluate shell expression as value
Feb 12, 2024
6c91903
Merge branch 'topic/native-compiler' of github.com:unisonweb/unison i…
Feb 12, 2024
79356fd
yaml step id
Feb 12, 2024
03c2d63
yaml update deprecated output convention
Feb 12, 2024
23f5b1e
yaml debug windows artifact failure
Feb 12, 2024
c3cbd23
yaml temporarily disable tests
Feb 12, 2024
6561343
yaml failing to uploading files is still success
Feb 12, 2024
b8a3435
yaml swearing
Feb 12, 2024
709f4a3
yaml whoops
Feb 12, 2024
e1e5798
yaml swearing+1
Feb 12, 2024
2d906cd
yaml maybe move bins somewhere nicer
Feb 12, 2024
6e37a5e
yaml getting desperate
Feb 12, 2024
004f797
yaml loving magical filenames
Feb 12, 2024
bacf978
yaml unmagic filenames. are duplicate ids ok?
Feb 12, 2024
8100d1f
yaml no good, does globbing work for upload-artifact?
Feb 13, 2024
e08a593
yaml test linux only, for a change
Feb 13, 2024
caf4471
yaml globs don't work
Feb 13, 2024
661c286
yaml copilot whoops
Feb 13, 2024
b9536da
skip tmate for now
Feb 13, 2024
65b13f4
yaml blowing up because we skipped ormolu?
Feb 13, 2024
1649abe
yaml slightly better?
Feb 13, 2024
25d703a
Merge branch 'trunk' into topic/native-compiler
Feb 13, 2024
c8773fb
yaml can i get an `if` that makes any sense
Feb 13, 2024
befb88b
comma
Feb 13, 2024
6405ad0
yaml switch plugin
Feb 13, 2024
16c9a7e
yaml x2
Feb 13, 2024
248dca0
yaml get scheme-libs/
Feb 13, 2024
c2c6de1
yaml missed one variable name swap
Feb 13, 2024
d8e2c61
yaml where are my files?
Feb 13, 2024
4a8a42d
yaml make temp scheme dir before
Feb 13, 2024
57360bf
yaml downloaded unison artifact filename is just called unison
Feb 13, 2024
9ea88f3
yaml maybe transcript was being overwritten by checkout
Feb 14, 2024
385625c
yaml create transcript with separate path and file
Feb 14, 2024
614f573
yaml try tmate again
Feb 14, 2024
b47102c
yaml i hope quotes don't matter
Feb 14, 2024
a99b763
yaml try finnp/create-file-action@v2 instead?
Feb 14, 2024
0020135
try DamianReeves/write-file-action@v1.3 instead
Feb 14, 2024
f8cae18
yaml don't need to run transcript here
Feb 14, 2024
36b59b6
yaml untmate
Feb 14, 2024
aaa62d1
commit racket deps list
Feb 14, 2024
7c43317
yaml no apt on windows
Feb 14, 2024
1d25ac7
yaml tmate
Feb 14, 2024
9c66492
yaml forget broken files-exist action
Feb 14, 2024
db73426
yaml skip clone if src not needed
Feb 14, 2024
0162dff
yaml always save jit source for next step (for now)
Feb 14, 2024
cc21138
yaml more yaml
Feb 14, 2024
22dd1ff
yaml all platforms without tmate
Feb 14, 2024
0ceea67
yaml set up base codebase
Feb 14, 2024
f56fb23
don't fetch internal
Feb 14, 2024
d5c4466
yaml typo
Feb 14, 2024
8cc6b87
yaml stop before jit tests
Feb 14, 2024
2e8ca88
yaml mac doesn't have apt either
Feb 14, 2024
851cc9c
yaml switch windows path separator
Feb 14, 2024
9b93372
yaml file existence plugins don't work
Feb 14, 2024
85ded90
yaml the lack of proper flow control is astounding
Feb 14, 2024
3e6aec4
yaml always checkout repo prior to running transcript from it
Feb 14, 2024
bb66d4c
yaml whoops
Feb 15, 2024
69f41b7
yaml no clue whats going on again
Feb 15, 2024
719bd7b
yaml remove caching condition
Feb 15, 2024
ae100d0
yaml works better when uncommented
Feb 15, 2024
f747904
yaml does overriding the default with the default make it work better?
Feb 15, 2024
a662a72
yaml lame that that worked
Feb 15, 2024
964cbe8
yaml try not to blow up on the second run
Feb 15, 2024
ddc303d
yaml argh
Feb 15, 2024
d64feb2
yaml disable pause again
Feb 15, 2024
e4f1563
yaml why did windows fail to build jit binary?
Feb 15, 2024
3421b61
yaml because of course you have to specify always
Feb 15, 2024
a42ccc6
yaml jump through some hoops re `.exe` on windows
Feb 15, 2024
3b7c24b
yaml small refactor, hope I don't regret it
Feb 15, 2024
02e5c3e
yaml it never ends
Feb 15, 2024
b668fe3
jit tests reply on some types not in base
Feb 15, 2024
3cc86fa
all the mergeio types we rely on should be in base I suppose?
Feb 15, 2024
719933b
Make --runtime-path expect full executable path
dolio Feb 15, 2024
596a58c
yaml change semantics of --runtime-path
Feb 16, 2024
29d7542
Merge branch 'topic/native-compiler' of github.com:unisonweb/unison i…
Feb 16, 2024
41c06a9
yaml definitely almost done
Feb 16, 2024
759de66
yaml fix jit source cache key
Feb 16, 2024
653da00
raco distribute builds a different directory structure in windows tha…
Feb 16, 2024
06643c9
yaml accidentally a )
Feb 16, 2024
da99454
yaml accidentally the other )
Feb 16, 2024
1bd7aef
yaml actually wanted jit version, not jit source hash which we don't …
Feb 16, 2024
61b3d68
yaml same here
Feb 16, 2024
ce5f1b8
simplify but hopefully not break caching
Feb 16, 2024
b607e7a
add ioexception message to ucr and raco failures.
Feb 16, 2024
6857bf9
yaml add windows-2022 os
Feb 16, 2024
ef3ff19
cache tips
Feb 16, 2024
08f36fb
yaml maybe less broken caching
Feb 16, 2024
2d0deab
beef up the error messages around calling the native runtime
Feb 16, 2024
ce6eed9
some reference info
Feb 16, 2024
ab7495d
do re-save ~/.stack if package dependencies have changed
Feb 16, 2024
3535473
do re-save `.stack-work` after build if Haskell files have changed
Feb 16, 2024
9042865
more debug info for calling raco
Feb 17, 2024
84188db
yaml nothing useful from windows-2022 after all
Feb 17, 2024
8e7ae67
yaml set 15 minute tmate timeout
Feb 17, 2024
053e7da
try to restore jit binaries before checking for them
Feb 17, 2024
f698543
yaml reenable all the ucm tests
Feb 17, 2024
1809b62
yaml whoops
Feb 17, 2024
fa24c65
another yaml reference
Feb 17, 2024
9c07533
yaml whoops
Feb 17, 2024
2d05cb0
yaml simplify and hopefully not break our diffs
Feb 17, 2024
544bd85
yaml move ucm local bin path out of repo?
Feb 17, 2024
7e29e4a
yaml hopefully skip hopefully unnecessary work
Feb 17, 2024
738e4fb
yaml rerun if transcripts have changed
Feb 17, 2024
7ed1b7d
yaml fixup windows slashes again
Feb 17, 2024
1a2a11e
yaml case sensitive env var names
Feb 17, 2024
887b9de
yaml blerk
Feb 17, 2024
f353c30
yaml skip failing interpreter tests in windows for now
Feb 17, 2024
e30c29b
caching tips
Feb 17, 2024
de3d792
skip jit integration test on windows
Feb 18, 2024
905a042
yaml: `timeout-minutes:` is a step setting, not an actions setting.
Feb 18, 2024
c42a019
yaml: skip base pull on cache hit
Feb 18, 2024
3b3ac4f
yaml move restore jit binaries step relative to environment tweak
Feb 18, 2024
6af7019
yaml switch environment tweak relative to restore jit binaries step
Feb 18, 2024
7995022
update github-actions-help
Feb 21, 2024
0859ca3
yaml: error if nothing to upload
Feb 23, 2024
5e6c6ca
yaml: work around https://github.com/actions/cache/issues/1334
Feb 23, 2024
d7eee10
yaml: will `--embed-dlls` allow jit integration test to succeed on wi…
Feb 24, 2024
50d0e11
yaml timeout was too short for debugging
Feb 24, 2024
f608a7a
update github-actions-help
Feb 27, 2024
9412098
commend
Feb 27, 2024
91e4311
Racket chunked seq fixes for base tests
dolio Feb 29, 2024
6c69ae6
Add additional universal compare cases in racket
dolio Feb 29, 2024
b4d5da1
Define some helper functions for modular arithmetic
dolio Feb 29, 2024
a261aa0
Implement modular arithmetic for Int/Nat
dolio Feb 29, 2024
805c9f1
Scope.bytearrayOf and missing imports from prior commit
dolio Feb 29, 2024
dfd482b
Racket pattern fixes
dolio Feb 29, 2024
d72f692
Add a version flag to unison-runtime and rework slightly
dolio Feb 29, 2024
5cf73d1
Fix char class stuff (more) properly
dolio Mar 1, 2024
46ad01e
Fix racket float to text formatting a bit to match Haskell
dolio Mar 1, 2024
24379d3
Tweak fromUtf8 error message; add IOFailure type in scheme
dolio Mar 1, 2024
3048be6
Merge remote-tracking branch 'origin/trunk' into topic/native-compiler
dolio Mar 1, 2024
aa53784
Bump gen-racket-libs version for @unison/internal
dolio Mar 4, 2024
197ce9a
Update ci.yaml with jit version 0.0.11
aryairani Mar 6, 2024
3433362
disable windows jit integration tests until #4705
Mar 7, 2024
28dd96b
yaml: temporarily print what's in the cached system stack dir
Mar 7, 2024
8926e19
yaml: add test caching and change a bunch of caching stuff
Mar 7, 2024
eb33604
yaml: forgot a plugin name
Mar 7, 2024
4e22249
yaml: temporarily print what's in the stack cache, better
Mar 7, 2024
62eab49
yaml: fix test results caching?
Mar 7, 2024
47c1826
yaml: bikeshed variable names and hope nothing broke
Mar 7, 2024
4a08bed
yaml: these were supposed to be part of a previous commit
Mar 7, 2024
20a0e73
yaml: call generateSchemeBoot directly from `@unison/internal`
Mar 7, 2024
e026d13
yaml: cache key vars for invalidation
Mar 7, 2024
4dc1023
CI docs
Mar 8, 2024
98eb284
Update ci.md
aryairani Mar 8, 2024
b0e8c76
Update ci.md
aryairani Mar 8, 2024
236d895
Update ci.md
aryairani Mar 8, 2024
db3e48f
yaml: clarify that you shouldn't have to invalidate build caches
Mar 8, 2024
8df8744
Merge branch 'topic/native-compiler' of github.com:unisonweb/unison i…
Mar 8, 2024
b7530a5
remove `compile.native.{fetch,genlibs}` commands
Mar 8, 2024
021677d
yaml: update stack caching
Mar 8, 2024
e8e610d
do we need `base.output.md`?
Mar 8, 2024
5034bf4
change default ucr location to `$0/runtime/unison-runtime[.exe]`
Mar 8, 2024
bf3a99f
yaml: maybe fix stack caching condition again?
Mar 8, 2024
9f2645d
yaml: predicate requires British spelling
Mar 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
yaml hopefully skip hopefully unnecessary work
  • Loading branch information
Arya Irani committed Feb 17, 2024
commit 7e29e4adb3bdab4836d490624a80c4c07c78888f
174 changes: 101 additions & 73 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,47 +73,56 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: cache ucm binaries
id: cache-ucm-binaries
uses: actions/cache@v4
with:
path: ${{runner.temp}}/${{env.ucm_local_bin}}
key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs') }}

# The number towards the beginning of the cache keys allow you to manually avoid using a previous cache.
# GitHub will automatically delete caches that haven't been accessed in 7 days, but there is no way to
# purge one manually.
- id: stackage-resolver
name: record stackage resolver
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
# looks for `resolver: nightly-yyyy-mm-dd` or `resolver: lts-xx.yy` in `stack.yaml` and splits it into
# `nightly` or `lts-xx`. the whole resolver string is put into resolver_long as a backup cache key
# ${{ steps.stackage-resolver.outputs.resolver_short }}
# ${{ steps.stackage-resolver.outputs.resolver_long }}
# `nightly` or `lts-xx`. the whole resolver string is put into $resolver as a backup cache key
# ${{ env.resolver_short }}
# ${{ env.resolver }}
run: |
grep resolver stack.yaml | awk '{ x="resolver_short="; if (split($2,a,"-") > 2) print x a[1]; else {split($2,b,"."); print x b[1]}}' >> "$GITHUB_OUTPUT"
grep resolver stack.yaml | awk '{print "resolver_long="$2}' >> "$GITHUB_OUTPUT"
grep resolver stack.yaml | awk '{ x="resolver_short="; if (split($2,a,"-") > 2) print x a[1]; else {split($2,b,"."); print x b[1]}}' >> "$GITHUB_ENV"
grep resolver stack.yaml | awk '{print "resolver="$2}' >> "$GITHUB_ENV"
# Cache ~/.stack, keyed by the contents of 'stack.yaml'.
- uses: actions/cache@v4
name: cache ~/.stack (unix)
if: runner.os != 'Windows'
- name: cache ~/.stack (non-Windows)
uses: actions/cache@v4
if: runner.os != 'Windows' && steps.cache-ucm-binaries.outputs.cache-hit != 'true'
with:
path: ~/.stack
key: stack-1_${{matrix.os}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
# Fall-back to use the most recent cache for the stack.yaml, or failing that the OS
restore-keys: stack-1_${{matrix.os}}-
key: stack-1_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
# Fall-back to use the most recent cache for this resolver
restore-keys: stack-1_${{matrix.os}}-${{env.resolver}}-
save-always: true

# Cache ~/.stack, keyed by the contents of 'stack.yaml'.
- uses: actions/cache@v4
name: cache ~/.stack (Windows)
if: runner.os == 'Windows'
- name: cache ~/.stack (Windows)
uses: actions/cache@v4
if: runner.os == 'Windows' && steps.cache-ucm-binaries.outputs.cache-hit != 'true'
with:
save-always: true
path: |
C:\Users\runneradmin\AppData\Roaming\stack
C:\Users\runneradmin\AppData\Local\Programs\stack
key: stack-1_${{matrix.os}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
# Fall-back to use the most recent cache for the stack.yaml, or failing that the OS
restore-keys: stack-1_${{matrix.os}}-
key: stack-1_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
# Fall-back to use the most recent cache for this resolver
restore-keys: stack-1_${{matrix.os}}-${{env.resolver}}-
save-always: true

# Cache each local package's ~/.stack-work for fast incremental builds in CI.
- uses: actions/cache@v4
name: cache .stack-work
- name: cache .stack-work
uses: actions/cache@v4
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
with:
save-always: true
path: |
**/.stack-work
# Main cache key: commit hash. This should always result in a cache miss...
Expand All @@ -122,32 +131,34 @@ jobs:
# recent branch cache.
# Then it will save a new cache at this commit sha, which should be used by
# the next build on this branch.
key: stack-work-4_${{matrix.os}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-${{hashFiles('**/*.hs')}}
key: stack-work-4_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-${{hashFiles('**/*.hs')}}
restore-keys: |
stack-work-4_${{matrix.os}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-
stack-work-4_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-
stack-work-4_${{matrix.os}}-${{env.resolver}}-
stack-work-4_${{matrix.os}}-
save-always: true

# Install stack by downloading the binary from GitHub.
# The installation process differs by OS.
- name: install stack (Linux)
if: runner.os == 'Linux'
if: runner.os == 'Linux' && steps.cache-ucm-binaries.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}
run: |
mkdir stack && cd stack
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.9.1/stack-2.9.1-linux-x86_64.tar.gz | tar -xz
echo "$PWD/stack-"* >> $GITHUB_PATH

- name: install stack (macOS)
if: runner.os == 'macOS' && steps.cache-ucm-binaries.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}
if: runner.os == 'macOS'
run: |
mkdir stack && cd stack
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.9.1/stack-2.9.1-osx-x86_64.tar.gz | tar -xz
echo "$PWD/stack-"* >> $GITHUB_PATH

- name: install stack (windows)
if: runner.os == 'Windows' && steps.cache-ucm-binaries.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}
if: runner.os == 'Windows'
run: |
mkdir stack && cd stack
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.9.1/stack-2.9.1-windows-x86_64.tar.gz | tar -xz
Expand All @@ -166,6 +177,7 @@ jobs:
# Build deps, then build local code. Splitting it into two steps just allows us to see how much time each step
# takes.
- name: build dependencies
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
# Run up to 5 times in a row before giving up.
# It's very unlikely that our build-dependencies step will fail on most builds,
# so if it fails its almost certainly due to a race condition on the Windows
Expand All @@ -180,84 +192,107 @@ jobs:
fi

for (( i = 0; i < $tries; i++ )); do
stack --no-terminal build --fast --only-dependencies && break;
stack build --fast --only-dependencies && break;
done
- name: build
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: |
stack build \
--fast \
--test \
--no-run-tests \
--no-terminal \
\
--local-bin-path ${{runner.temp}}/${{env.ucm_local_bin}} \
--copy-bins

- name: output ucm path
id: ucm-path
run: |
if [[ ${{runner.os}} = "Windows" ]]; then
echo "ucm-path=${{runner.temp}}/${{env.ucm_local_bin}}/unison.exe" >> $GITHUB_OUTPUT
echo "ucm=${{runner.temp}}/${{env.ucm_local_bin}}/unison.exe" >> $GITHUB_ENV
else
echo "ucm-path=${{runner.temp}}/${{env.ucm_local_bin}}/unison" >> $GITHUB_OUTPUT
echo "ucm=${{runner.temp}}/${{env.ucm_local_bin}}/unison" >> $GITHUB_ENV
fi

# Run each test suite (tests and transcripts)
- name: check disk space before
if: ${{ always() }}
run: df -h
- name: unison-cli test
run: stack --no-terminal build --fast --test unison-cli
- name: check disk space after
if: ${{ always() }}
run: df -h
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-cli

- name: unison-core tests
run: stack --no-terminal build --fast --test unison-core
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-core

- name: unison-parser-typechecker tests
run: stack --no-terminal build --fast --test unison-parser-typechecker
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-parser-typechecker

- name: unison-sqlite tests
run: stack --no-terminal build --fast --test unison-sqlite
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-sqlite

- name: unison-syntax tests
run: stack --no-terminal build --fast --test unison-syntax
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-syntax

- name: unison-util-bytes tests
run: stack --no-terminal build --fast --test unison-util-bytes
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-util-bytes

- name: unison-util-cache tests
run: stack --no-terminal build --fast --test unison-util-cache
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-util-cache

- name: unison-util-relation tests
run: stack --no-terminal build --fast --test unison-util-relation
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack build --fast --test unison-util-relation

- name: round-trip-tests
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: |
stack --no-terminal exec unison transcript unison-src/transcripts-round-trip/main.md
stack --no-terminal exec unison transcript unison-src/transcripts-manual/rewrites.md
${{env.ucm}} transcript unison-src/transcripts-round-trip/main.md
${{env.ucm}} transcript unison-src/transcripts-manual/rewrites.md
# Fail if any transcripts cause git diffs.
git diff --ignore-cr-at-eol --exit-code \
unison-src/transcripts-round-trip/main.output.md \
unison-src/transcripts-manual/rewrites.output.md

- name: transcripts
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: |
stack --no-terminal exec transcripts
${{runner.temp}}/${{env.ucm_local_bin}}/transcripts
# Fail if any transcripts cause git diffs.
git diff --ignore-cr-at-eol --exit-code unison-src/transcripts

- name: cli-integration-tests
run: stack --no-terminal exec cli-integration-tests
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: stack exec cli-integration-tests

- name: verify stack ghci startup
if: runner.os == 'macOS'
if: runner.os == 'macOS' && steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: echo | stack ghci

- name: debug check ucm artifact
- name: cache base codebase
uses: actions/cache@v4
with:
path: ${{ env.base-codebase }}
# this key probably needs something about the schema version too
key: base.unison_${{hashFiles('**/unison-src/builtin-tests/base.md')}}.

- name: create base.md codebase
run: ${{env.ucm}} transcript.fork -C ${{env.base-codebase}} -S ${{env.base-codebase}} unison-src/builtin-tests/base.md

- name: interpreter tests
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
run: |
ls -l ${{ env.ucm_local_bin }}
ls -l ${{ steps.ucm-path.outputs.ucm-path }}
${{ env.ucm }} transcript.fork -c ${{env.base-codebase}} unison-src/builtin-tests/interpreter-tests.md
cat unison-src/builtin-tests/interpreter-tests.output.md
git diff --exit-code unison-src/builtin-tests/interpreter-tests.output.md

- name: save ucm artifact
uses: actions/upload-artifact@v4
with:
name: unison-${{ matrix.os }}
path: ${{ steps.ucm-path.outputs.ucm-path }}
path: ${{ env.ucm }}
if-no-files-found: error

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ always() }}
generate-jit-source:
if: always() && needs.build-ucm.result == 'success'
name: Generate JIT source
Expand Down Expand Up @@ -454,12 +489,6 @@ jobs:
name: jit-binary-${{ matrix.os }}
path: ${{ env.jit_dist }}/**

- name: cache base.md codebase
uses: actions/cache@v4
with:
path: ${{ env.base-codebase}}
key: base.unison_${{hashFiles('**/unison-src/builtin-tests/base.md')}}.

- name: download ucm
uses: actions/download-artifact@v4
with:
Expand All @@ -469,23 +498,22 @@ jobs:
- name: set ucm permissions
run: chmod +x ${{ env.ucm }}

- name: get base codebase
uses: actions/cache/restore@v4
with:
path: ${{ env.base-codebase}}
key: base.unison_${{hashFiles('**/unison-src/builtin-tests/base.md')}}.

- name: create base.md codebase
run: ${{env.ucm}} transcript.fork -C ${{env.base-codebase}} -S ${{env.base-codebase}} unison-src/builtin-tests/base.md

- name: jit tests ${{ matrix.os }}
# if: steps.checks.outputs.jit_dist_exists == 'false'
run: |
time ${{ env.ucm }} transcript.fork --runtime-path ${{ env.jit_dist_exe }} -c ${{env.base-codebase}} unison-src/builtin-tests/jit-tests.md
${{ env.ucm }} transcript.fork --runtime-path ${{ env.jit_dist_exe }} -c ${{env.base-codebase}} unison-src/builtin-tests/jit-tests.md
cat unison-src/builtin-tests/jit-tests.output.md
git diff --exit-code unison-src/builtin-tests/jit-tests.output.md

- name: interpreter tests
# if: steps.checks.outputs.jit_dist_exists == 'false'
run: |
time ${{ env.ucm }} transcript.fork -c ${{env.base-codebase}} unison-src/builtin-tests/interpreter-tests.md
cat unison-src/builtin-tests/interpreter-tests.output.md
git diff --exit-code unison-src/builtin-tests/interpreter-tests.output.md

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
Expand Down
Loading