Test Rebol Whitespacers #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Rebol Whitespacers | |
on: | |
push: | |
branches: [ | |
main | |
] | |
pull_request: | |
branches: [ | |
main | |
] | |
workflow_dispatch: # Allows running this workflow manually from Actions tab | |
jobs: | |
test-whitespacers: | |
# The whitespace tests are short and quick enough to not be too much of a | |
# burden on the world, so go ahead and do run it for the release and debug | |
# builds on the main desktop platforms. | |
# | |
# (Rather than use the automatic-matrix'ing, we go ahead and list them | |
# manually, because that makes it easier to tweak specifics if desired.) | |
# | |
strategy: | |
matrix: | |
include: # put in order of visibility importance (shown in UI) | |
- os: macos-latest | |
checked: false | |
- os: windows-latest | |
checked: false | |
- os: ubuntu-latest | |
checked: false | |
- os: macos-latest | |
checked: true | |
- os: windows-latest | |
checked: true | |
- os: ubuntu-latest | |
checked: true | |
# https://github.com/actions/virtual-environments#available-environments | |
# | |
runs-on: ${{ matrix.os }} | |
steps: | |
#====# CHECKOUT STEPS #=====================================================# | |
# GitHub CI checkout on Windows auto translates LF to CR/LF in files: | |
# | |
# https://github.com/actions/checkout/issues/135 | |
# | |
# However, Ren-C is taking the long view on this and prohibiting CR/LF in | |
# source by default. | |
# | |
# https://forum.rebol.info/t/newlina-non-grata/1207 | |
# https://forum.rebol.info/t/1264 | |
# | |
- name: Disable LF to CRLF Auto Translation In Git | |
if: matrix.os == 'windows-latest' | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
# https://github.com/actions/checkout | |
# | |
- uses: actions/checkout@v3 | |
#====# INSTALL R3 INTERPRETER #=============================================# | |
- name: Download and Cache the Interpreter | |
uses: metaeducation/ren-c-action@release | |
with: | |
checked: ${{ matrix.checked }} | |
#====# REN-C VERSION TEST STEPS #===========================================# | |
# Ren-C is an aggressively redesigned version of the open-source Rebol | |
# R3-Alpha code. The whitespace script that runs on Ren-C establishes a | |
# sort of "domain specific language" for writing "Whitespace-like" | |
# interpreters. | |
# | |
# If the interpreter FAILs due to an internal error it will return an exit | |
# code of 1, and 0 returned on success. But we also want to check the | |
# output matches what was expected. To do that in a cross-platform way, | |
# use Ren-C CALL to invoke a Ren-C subprocess to run the interpreter, | |
# save the output to a string, and compare to a known result. | |
- name: Original Count-to-10 Tutorial Test, .ws Format | |
run: | | |
r3 tests/check-io.reb examples/count.ws --out tests/count.out | |
- name: Original Count-to-10 Tutorial Test, .wsw Format | |
run: | | |
r3 tests/check-io.reb examples/count.wsw --out tests/count.out | |
- name: Hello World (also tests running from URL!) | |
run: | | |
r3 tests/check-io.reb https://raw.githubusercontent.com/hostilefork/rebol-whitespacers/main/examples/hworld.ws --out tests/hworld.out | |
- name: Summing Calculator (also tests running from FILE!) | |
run: | | |
r3 tests/check-io.reb %examples/calc.ws --in tests/calc.in --out tests/calc.out | |
- name: Factorial | |
run: | | |
r3 tests/check-io.reb examples/fact.ws --in tests/fact.in --out tests/fact.out | |
- name: Towers of Hanoi | |
run: | | |
r3 tests/check-io.reb examples/hanoi.ws --in tests/hanoi.in --out tests/hanoi.out | |
- name: Name Greeter | |
run: | | |
r3 tests/check-io.reb examples/name.ws --in tests/name.in --out tests/name.out | |
- name: Whitespace 0.3 Instructions Test | |
run: | | |
r3 tests/check-io.reb examples/loctest.ws --in tests/loctest.in --out tests/loctest.out | |
#====# "REDBOL" VERSION TEST STEPS #========================================# | |
# The original Rebol version written circa 2010 ran in the pre-open-source | |
# "R3-Alpha" interpreter. That less interesting version still runs today | |
# relatively unchanged under emulation via "Redbol", and is kept around as | |
# a test of that emulation. | |
# | |
- name: Historical Rebol Interpreter Test | |
uses: metaeducation/ren-c-action@release | |
with: | |
checked: ${{ matrix.checked }} | |
script: | | |
do %historical/whitespace-old.reb ; has program hardcoded in it |