-
-
Notifications
You must be signed in to change notification settings - Fork 25
271 lines (243 loc) · 6.36 KB
/
test_language_bindings.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: "Test: Language Bindings"
# To add a new language binding test
# - Add a new job with your test
# - Add the new job to the list of 'needs' in `test_all_langs`
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test_all_langs:
name: "All Language Tests Complete"
needs:
- test_Cpp
- test_csharp
- test_go
- test_haskell
- test_java
- test_javascript
- test_julia
- test_lua
- test_perl
- test_php
- test_R
- test_ruby
- test_rust
runs-on: ubuntu-latest
steps:
- name: NoOp
run: echo 'Done'
test_Cpp:
name: "Test: C++"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: make
run: |
make cpp
test_csharp:
name: "Test: C#"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: prereqs
# https://linuxize.com/post/how-to-install-mono-on-ubuntu-20-04/
run: |
sudo apt-get update
sudo apt-get install gnupg apt-transport-https ca-certificates software-properties-common -y
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-focal main'
sudo apt install mono-complete
mono --version
- name: execute
run: |
make cs
test_go:
name: "Test: GoLang"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: go install
run: sudo apt install golang-go
- name: make go
run: make go
test_haskell:
name: "Test: Haskell"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: dep install
run: |
sudo apt update
sudo apt install cabal-install haskell-stack ghc
ghc --version
cabal update
- name: make haskell
run: |
make haskell
cd src/haskell/ && cabal run src d20
test_java:
name: "Test: Java"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: java dependencies
run: |
sudo apt-get update
sudo apt-get install default-jdk -y
sudo apt-get install openjdk-8-jdk -y
- name: make java
run: |
make java
test_javascript:
name: "Test: JavaScript"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
- name: python deps
run: python3 -m pip install -r reqs/requirements.txt
- name: apt prerequisites
run: |
sudo apt install clang-14 lld-14 llvm-14 libjs-d3 python3-numpy
sudo apt install llvm -y
- name: javascript prerequisites
run: |
# NodeJS
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Acorn-Node
git clone https://github.com/acornjs/acorn.git
cd acorn ; npm install ; cd -
yarn global add webpack webpack-cli
npm i -g webpack-cli -D --save
npm install webpack-cli
cd src/js ;npm install webpack-cli
yarn add -D webpack-cli ; cd -
# Emscripten
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk ; ./emsdk install latest ; cd -
# wget --no-verbose -c http://archive.ubuntu.com/ubuntu/pool/universe/e/emscripten/emscripten_3.1.6~dfsg-5_all.deb
# sudo apt install -f ./emscripten_3.1.6~dfsg-5_all.deb nodejs- node-acorn- # ignore nodejs acorn max version
- name: make js
run: |
cd emsdk ; ./emsdk activate latest ; source ./emsdk_env.sh ; cd -
emcc -v
make js
node ./build/js/a.out.js 1d20
- name: make jsweb
run: |
cd emsdk ; ./emsdk activate latest ; source ./emsdk_env.sh ; cd -
emcc -v
make jsbundle
test_julia:
name: "Test: Julia"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: julia install
run: |
wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.2-linux-x86_64.tar.gz
tar zxvf julia-1.8.2-linux-x86_64.tar.gz
export PATH="$PATH:$PWD/julia-1.8.2/bin"
- name: make julia
run: |
PATH="$PATH:$PWD/julia-1.8.2/bin" make julia
test_lua:
name: "Test: Lua"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: lua install
run: |
sudo apt install luajit
- name: make lua
run: make lua
test_perl:
name: "Test: Perl"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: perl install
run: |
sudo apt install perl
- name: make perl
run: make perl
- name: test perl
run: perl src/perl/example_application.pl
test_R:
name: "Test: R"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: r-lib/actions/setup-r@v2
- name: make r
run: make r
test_ruby:
name: "Test: Ruby"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: ruby install
run: |
sudo apt install ruby-full
sudo gem install ffi
- name: make ruby
run: make ruby
test_php:
name: "Test: PHP"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
ini-values: enable_dl=True
extensions: dice
env:
DICE_PATH: src/PHP/
- name: make php
run: make php
test_rust:
name: "Test: Rust"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Run Rust
run: |
make rust