-
Notifications
You must be signed in to change notification settings - Fork 9
156 lines (128 loc) · 4.21 KB
/
test-repl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#
# File: %test-repl.yml
#
#=============================================================================#
#
# This is just the web repl testing part of the Web Build Workflow.
#
# It is factored out so the REPL can be tested without doing a full build of
# the Ren-C interpreter.
name: Test Repl
# See README: When To Trigger Builds
#
on:
push:
branches: [
master
]
pull_request:
branches: [
master
]
workflow_dispatch: # Allows running this workflow manually from Actions tab
# Standardize to use bash on all platforms.
#
# See README: Using The Strict Erroring Bash Shell
#
defaults:
run:
shell: bash
# Each "Job" runs in its own VM, and a workflow run is made up of one or more
# jobs that can run sequentially or in parallel.
#
# See README: Jobs
#
jobs:
test-repl: # Name of this workflow's only job
# https://github.com/actions/virtual-environments#available-environments
#
runs-on: ubuntu-20.04
# See README: Build Matrix
#
strategy:
matrix:
include:
- os-id: 0.16.1 # "asyncify" Emscripten build (only variant ATM)
# Steps are a sequence of tasks that will be executed within a single VM
# as part of the job.
#
# See README: Steps
#
steps: # (no indentatation needed below; so indent the minimum!)
#====# CHECKOUT STEPS #=====================================================#
# https://github.com/actions/checkout
#
# See README: Checkout Action
#
- uses: actions/checkout@v2 # See README: Trusted Actions
# The full commit is passed to make to build into the binary, and the
# abbreviated commit is used to name the executable.
#
# See README: Portably Capturing Git Hashes
#
- name: Grab Git Hash and Short Hash Into Environment Variables
run: |
git_commit="$(git show --format="%H" --no-patch)"
git_commit_short="$(git show --format="%h" --no-patch)"
echo "GIT_COMMIT=$git_commit" >> $GITHUB_ENV
echo "GIT_COMMIT_SHORT=$git_commit_short" >> $GITHUB_ENV
#====# TESTING STEPS #======================================================#
# The ren-c-action is able to deploy a web browser and automate it. It
# does this via a local Firefox, which it talks to through Python equipped
# with the "Marionette" protocol. (Ren-C can't be used for the protocol at
# time of writing, because it lacks websockets...which are needed to
# remote-control Firefox. Chrome DevTools are similar.)
- name: LATEST-OF Smoke Test
if: github.ref == 'refs/heads/master' # see notes on UPLOAD STEPS
uses: metaeducation/ren-c-action@release
with:
web: true
timeout: 15
screenshot: latest-of
script: |
(url: latest-of)
print ["Result was:" mold url]
assert [url? url]
- name: Watchlist Smoke Test
if: github.ref == 'refs/heads/master' # see notes on UPLOAD STEPS
uses: metaeducation/ren-c-action@release
with:
web: true
timeout: 15
screenshot: watch
script: |
x: 10
watch x
assert [10 = watch 1]
- name: Redbol Smoke Test
if: github.ref == 'refs/heads/master' # see notes on UPLOAD STEPS
uses: metaeducation/ren-c-action@release
with:
web: true
timeout: 15
screenshot: redbol
script: |
redbol
block: [b c]
assert [[a b c d] = compose [a (block) d]]
# Early on, @gchiu wrote some code to interoperate with a JS chess board.
# Since we have that example, test that it works. We don't know what the
# screen looks like, but we can check it loads and runs to completion with
# the shortest possible gameplay.
#
- name: Test Chess GUI Example
if: github.ref == 'refs/heads/master' # see notes on UPLOAD STEPS
uses: metaeducation/ren-c-action@release
with:
web: true
timeout: 15
screenshot: chess
script: |
animate-game: do @chess
assert [
comment [https://en.wikipedia.org/wiki/Fool%27s_mate]
<done> = animate-game [
f2f3 e7e6
g2g4 d8h4
]
]