1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-23 12:14:45 +03:00

Refactor Github Actions/Travis CI

- Dynamically generate a strategy matrix based on the list of changed
  files in this push/pull_request. If the changed files are restricted
  to implementations then only generate a matrix with those
  implementations. If the changes are to tests or other
  non-documentation files (runtest.py, IMPLS.yml, .github/*, etc) then
  run the full set. The matrix generation is done in get-ci-matrix.py.
- Split the implementation list for Github Actions out into a separate
  yaml file IMPLS.yml
- Reduce the travis file to just the OS X / XCode related builds that
  aren't supported on Github Actions.
- Rename the .travis_test.sh script to ci.sh since it is the general
  CI script used for both Travis CI and Github Actions.
This commit is contained in:
Joel Martin 2021-04-19 18:39:03 -05:00
parent f0863c2cc7
commit 021d107db7
8 changed files with 398 additions and 420 deletions

View File

@ -3,144 +3,50 @@ name: Build and Test
on: [push, pull_request]
jobs:
get-matrix:
runs-on: ubuntu-20.04
outputs:
do-linux: ${{ steps.get-matrix-step.outputs.do-linux }}
matrix-linux: ${{ steps.get-matrix-step.outputs.linux }}
do-macos: ${{ steps.get-matrix-step.outputs.do-macos }}
matrix-macos: ${{ steps.get-matrix-step.outputs.macos }}
steps:
- uses: actions/checkout@v2
- id: files
uses: kanaka/get-changed-files@v1
- id: get-matrix-step
run: ./get-ci-matrix.py ${{ steps.files.outputs.all }}
linux:
needs: get-matrix
if: ${{ needs.get-matrix.outputs.do-linux == 'true' }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
IMPL:
- IMPL=ada
- IMPL=ada.2
- IMPL=awk
- IMPL=bash NO_SELF_HOST=1
- IMPL=basic basic_MODE=cbm NO_SELF_HOST=1
- IMPL=basic basic_MODE=qbasic NO_SELF_HOST=1
- IMPL=bbc-basic
- IMPL=c
- IMPL=cpp
- IMPL=coffee
- IMPL=cs
- IMPL=chuck NO_SELF_HOST_PERF=1
- IMPL=clojure clojure_MODE=clj
- IMPL=clojure clojure_MODE=cljs
- IMPL=common-lisp
- IMPL=crystal
- IMPL=d d_MODE=gdc
- IMPL=d d_MODE=ldc2
- IMPL=d d_MODE=dmd
- IMPL=dart
- IMPL=elisp
- IMPL=elixir
- IMPL=elm
- IMPL=erlang NO_SELF_HOST=1
- IMPL=es6
- IMPL=factor
- IMPL=fantom
- IMPL=forth
- IMPL=fsharp
- IMPL=go
- IMPL=groovy
- IMPL=gnu-smalltalk
- IMPL=guile
- IMPL=haskell
- IMPL=haxe haxe_MODE=neko
- IMPL=haxe haxe_MODE=python
- IMPL=haxe haxe_MODE=cpp
- IMPL=haxe haxe_MODE=js
- IMPL=hy
- IMPL=io NO_SELF_HOST_PERF=1
- IMPL=java
- IMPL=jq
- IMPL=js
- IMPL=julia
- IMPL=kotlin
- IMPL=livescript
- IMPL=logo NO_SELF_HOST=1
- IMPL=lua
- IMPL=make NO_SELF_HOST=1
- IMPL=mal MAL_IMPL=js BUILD_IMPL=js NO_SELF_HOST=1
- IMPL=mal MAL_IMPL=js-mal BUILD_IMPL=js NO_SELF_HOST=1 NO_PERF=1
- IMPL=mal MAL_IMPL=nim BUILD_IMPL=nim NO_SELF_HOST=1
- IMPL=mal MAL_IMPL=nim-mal BUILD_IMPL=nim NO_SELF_HOST=1 NO_PERF=1
- IMPL=matlab NO_SELF_HOST_PERF=1
- IMPL=miniMAL NO_SELF_HOST_PERF=1
- IMPL=nasm NO_SELF_HOST_PERF=1
- IMPL=nim
- IMPL=objpascal
# IMPL=objc NO_DOCKER=1 os: osx osx_image: xcode7}
- IMPL=objc
- IMPL=ocaml
- IMPL=perl
- IMPL=perl6
- IMPL=php
- IMPL=picolisp
- IMPL=pike
- IMPL=plpgsql NO_SELF_HOST=1
# - IMPL=plsql
- IMPL=prolog
- IMPL=ps
- IMPL=powershell NO_SELF_HOST_PERF=1
- IMPL=python python_MODE=python2
- IMPL=python python_MODE=python3
- IMPL=python.2
- IMPL=r
- IMPL=racket
- IMPL=rexx
- IMPL=rpython
- IMPL=ruby
- IMPL=rust
- IMPL=scala
- IMPL=scheme scheme_MODE=chibi
- IMPL=scheme scheme_MODE=kawa
- IMPL=scheme scheme_MODE=gauche
- IMPL=scheme scheme_MODE=chicken
- IMPL=scheme scheme_MODE=sagittarius
- IMPL=scheme scheme_MODE=cyclone
# - IMPL=scheme scheme_MODE=foment
- IMPL=skew
- IMPL=tcl
- IMPL=ts
- IMPL=vala
- IMPL=vb
- IMPL=vhdl NO_SELF_HOST_PERF=1
- IMPL=vimscript
- IMPL=wasm wasm_MODE=wasmtime NO_SELF_HOST_PERF=1 NO_PERF=1
- IMPL=wasm wasm_MODE=wasmer NO_SELF_HOST_PERF=1 NO_PERF=1
- IMPL=wasm wasm_MODE=lucet NO_SELF_HOST_PERF=1 NO_PERF=1
- IMPL=wasm wasm_MODE=wax NO_SELF_HOST_PERF=1
- IMPL=wasm wasm_MODE=node NO_SELF_HOST_PERF=1 NO_PERF=1
- IMPL=wasm wasm_MODE=warpy NO_SELF_HOST_PERF=1
- IMPL=wasm wasm_MODE=wace_libc NO_SELF_HOST_PERF=1
- IMPL=wren
- IMPL=xslt
- IMPL=yorick
- IMPL=zig
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix-linux) }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: IMPL testing
run: |
export ${{ matrix.IMPL }}
./.travis_test.sh build ${IMPL}
./.travis_test.sh test ${IMPL}
STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./.travis_test.sh test ${IMPL}
./.travis_test.sh perf ${IMPL}
./ci.sh build ${IMPL}
./ci.sh test ${IMPL}
STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./ci.sh test ${IMPL}
./ci.sh perf ${IMPL}
macos:
needs: get-matrix
if: ${{ needs.get-matrix.outputs.do-macos == 'true' }}
runs-on: macos-10.15
strategy:
fail-fast: false
matrix:
IMPL:
# - IMPL=swift NO_DOCKER=1
# - IMPL=swift3 NO_DOCKER=1
# - IMPL=swift4 NO_DOCKER=1
- IMPL=swift5 NO_DOCKER=1
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix-macos) }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: IMPL testing
run: |
export ${{ matrix.IMPL }}
./.travis_test.sh build ${IMPL}
./.travis_test.sh test ${IMPL}
STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./.travis_test.sh test ${IMPL}
./.travis_test.sh perf ${IMPL}
./ci.sh build ${IMPL}
./ci.sh test ${IMPL}
STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./ci.sh test ${IMPL}
./ci.sh perf ${IMPL}

View File

@ -5,124 +5,15 @@ sudo: required
matrix:
include:
- {env: IMPL=ada, services: [docker]}
- {env: IMPL=ada.2, services: [docker]}
- {env: IMPL=awk, services: [docker]}
- {env: IMPL=bash NO_SELF_HOST=1, services: [docker]} # step8 timeout
- {env: IMPL=basic basic_MODE=cbm NO_SELF_HOST=1, services: [docker]} # step4 OOM
- {env: IMPL=basic basic_MODE=qbasic NO_SELF_HOST=1, services: [docker]} # step4 OOM
- {env: IMPL=bbc-basic, services: [docker]}
- {env: IMPL=c, services: [docker]}
- {env: IMPL=cpp, services: [docker]}
- {env: IMPL=coffee, services: [docker]}
- {env: IMPL=cs, services: [docker]}
- {env: IMPL=chuck NO_SELF_HOST_PERF=1, services: [docker]} # perf OOM
- {env: IMPL=clojure clojure_MODE=clj, services: [docker]}
- {env: IMPL=clojure clojure_MODE=cljs, services: [docker]}
- {env: IMPL=common-lisp, services: [docker]}
- {env: IMPL=crystal, services: [docker]}
- {env: IMPL=d d_MODE=gdc, services: [docker]}
- {env: IMPL=d d_MODE=ldc2, services: [docker]}
- {env: IMPL=d d_MODE=dmd, services: [docker]}
- {env: IMPL=dart, services: [docker]}
- {env: IMPL=elisp, services: [docker]}
- {env: IMPL=elixir, services: [docker]}
- {env: IMPL=elm, services: [docker]}
- {env: IMPL=erlang NO_SELF_HOST=1, services: [docker]} # step8 OOM
- {env: IMPL=es6, services: [docker]}
- {env: IMPL=factor, services: [docker]}
- {env: IMPL=fantom, services: [docker]}
- {env: IMPL=forth, services: [docker]}
- {env: IMPL=fsharp, services: [docker]}
- {env: IMPL=go, services: [docker]}
- {env: IMPL=groovy, services: [docker]}
- {env: IMPL=gnu-smalltalk, services: [docker]}
- {env: IMPL=guile, services: [docker]}
- {env: IMPL=haskell, services: [docker]}
- {env: IMPL=haxe haxe_MODE=neko, services: [docker]}
- {env: IMPL=haxe haxe_MODE=python, services: [docker]}
- {env: IMPL=haxe haxe_MODE=cpp, services: [docker]}
- {env: IMPL=haxe haxe_MODE=js, services: [docker]}
- {env: IMPL=hy, services: [docker]}
- {env: IMPL=io NO_SELF_HOST_PERF=1, services: [docker]} # perf OOM
- {env: IMPL=java, services: [docker]}
- {env: IMPL=jq, services: [docker]}
- {env: IMPL=js, services: [docker]}
- {env: IMPL=julia, services: [docker]}
- {env: IMPL=kotlin, services: [docker]}
- {env: IMPL=livescript, services: [docker]}
- {env: IMPL=logo NO_SELF_HOST=1, services: [docker]} # step4 timeout
- {env: IMPL=lua, services: [docker]}
- {env: IMPL=make NO_SELF_HOST=1, services: [docker]} # step4 timeout
- {env: IMPL=mal MAL_IMPL=js BUILD_IMPL=js NO_SELF_HOST=1, services: [docker]}
- {env: IMPL=mal MAL_IMPL=js-mal BUILD_IMPL=js NO_SELF_HOST=1 NO_PERF=1, services: [docker]}
- {env: IMPL=mal MAL_IMPL=nim BUILD_IMPL=nim NO_SELF_HOST=1, services: [docker]}
- {env: IMPL=mal MAL_IMPL=nim-mal BUILD_IMPL=nim NO_SELF_HOST=1 NO_PERF=1, services: [docker]}
- {env: IMPL=matlab NO_SELF_HOST_PERF=1, services: [docker]} # Octave, perf timeout
- {env: IMPL=miniMAL NO_SELF_HOST_PERF=1, services: [docker]} # perf timeout
- {env: IMPL=nasm NO_SELF_HOST_PERF=1, services: [docker]} # perf OOM
- {env: IMPL=nim, services: [docker]}
- {env: IMPL=objpascal, services: [docker]}
- {env: IMPL=objc NO_DOCKER=1, os: osx, osx_image: xcode7}
- {env: IMPL=objc, services: [docker]}
- {env: IMPL=ocaml, services: [docker]}
- {env: IMPL=perl, services: [docker]}
- {env: IMPL=perl6, services: [docker]}
- {env: IMPL=php, services: [docker]}
- {env: IMPL=picolisp, services: [docker]}
- {env: IMPL=pike, services: [docker]}
- {env: IMPL=plpgsql NO_SELF_HOST=1, services: [docker]} # step3 timeout
# - {env: IMPL=plsql, services: [docker]}
- {env: IMPL=prolog, services: [docker]}
- {env: IMPL=ps, services: [docker]}
- {env: IMPL=powershell NO_SELF_HOST_PERF=1, services: [docker]} # perf timeout
- {env: IMPL=python python_MODE=python2, services: [docker]}
- {env: IMPL=python python_MODE=python3, services: [docker]}
- {env: IMPL=python.2, services: [docker]}
- {env: IMPL=r, services: [docker]}
- {env: IMPL=racket, services: [docker]}
- {env: IMPL=rexx, services: [docker]}
- {env: IMPL=rpython, services: [docker]}
- {env: IMPL=ruby, services: [docker]}
- {env: IMPL=rust, services: [docker]}
- {env: IMPL=scala, services: [docker]}
- {env: IMPL=scheme scheme_MODE=chibi, services: [docker]}
- {env: IMPL=scheme scheme_MODE=kawa, services: [docker]}
- {env: IMPL=scheme scheme_MODE=gauche, services: [docker]}
- {env: IMPL=scheme scheme_MODE=chicken, services: [docker]}
- {env: IMPL=scheme scheme_MODE=sagittarius, services: [docker]}
- {env: IMPL=scheme scheme_MODE=cyclone, services: [docker]}
# - {env: IMPL=scheme scheme_MODE=foment, services: [docker]}
- {env: IMPL=skew, services: [docker]}
- {env: IMPL=swift NO_DOCKER=1, os: osx, osx_image: xcode7.3}
- {env: IMPL=swift3, services: [docker]}
- {env: IMPL=swift3 NO_DOCKER=1, os: osx, osx_image: xcode8}
- {env: IMPL=swift4, services: [docker]}
- {env: IMPL=swift4 NO_DOCKER=1, os: osx, osx_image: xcode10}
- {env: IMPL=swift5, services: [docker]}
- {env: IMPL=swift5 NO_DOCKER=1, os: osx, osx_image: xcode11}
- {env: IMPL=tcl, services: [docker]}
- {env: IMPL=ts, services: [docker]}
- {env: IMPL=vala, services: [docker]}
- {env: IMPL=vb, services: [docker]}
- {env: IMPL=vhdl NO_SELF_HOST_PERF=1, services: [docker]} # perf timeout
- {env: IMPL=vimscript, services: [docker]}
# no self-host perf for wasm due to mac stack overflow
- {env: IMPL=wasm wasm_MODE=wasmtime NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wasm wasm_MODE=wasmer NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wasm wasm_MODE=lucet NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wasm wasm_MODE=wax NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wasm wasm_MODE=node NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wasm wasm_MODE=warpy NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wasm wasm_MODE=wace_libc NO_SELF_HOST_PERF=1, services: [docker]}
- {env: IMPL=wren, services: [docker]}
- {env: IMPL=xslt, services: [docker]}
- {env: IMPL=yorick, services: [docker]}
- {env: IMPL=zig, services: [docker]}
script:
# Build, test, perf
- ./.travis_test.sh build ${IMPL}
- ./.travis_test.sh test ${IMPL}
- STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./.travis_test.sh test ${IMPL}
- ./.travis_test.sh perf ${IMPL}
- ./ci.sh build ${IMPL}
- ./ci.sh test ${IMPL}
- STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./ci.sh test ${IMPL}
- ./ci.sh perf ${IMPL}

114
IMPLS.yml Normal file
View File

@ -0,0 +1,114 @@
IMPL:
- {IMPL: ada}
- {IMPL: ada.2}
- {IMPL: awk}
- {IMPL: bash, NO_SELF_HOST: 1} # step8 timeout
- {IMPL: basic, basic_MODE: cbm, NO_SELF_HOST: 1} # step4 OOM
- {IMPL: basic, basic_MODE: qbasic, NO_SELF_HOST: 1} # step4 OOM
- {IMPL: bbc-basic}
- {IMPL: c}
- {IMPL: cpp}
- {IMPL: coffee}
- {IMPL: cs}
- {IMPL: chuck, NO_SELF_HOST_PERF: 1} # perf OOM
- {IMPL: clojure, clojure_MODE: clj}
- {IMPL: clojure, clojure_MODE: cljs}
- {IMPL: common-lisp}
- {IMPL: crystal}
- {IMPL: d, d_MODE: gdc}
- {IMPL: d, d_MODE: ldc2}
- {IMPL: d, d_MODE: dmd}
- {IMPL: dart}
- {IMPL: elisp}
- {IMPL: elixir}
- {IMPL: elm}
- {IMPL: erlang, NO_SELF_HOST: 1} # step8 OOM
- {IMPL: es6}
- {IMPL: factor}
- {IMPL: fantom}
- {IMPL: forth}
- {IMPL: fsharp}
- {IMPL: go}
- {IMPL: groovy}
- {IMPL: gnu-smalltalk}
- {IMPL: guile}
- {IMPL: haskell}
- {IMPL: haxe, haxe_MODE: neko}
- {IMPL: haxe, haxe_MODE: python}
- {IMPL: haxe, haxe_MODE: cpp, SLOW: 1}
- {IMPL: haxe, haxe_MODE: js}
- {IMPL: hy}
- {IMPL: io, NO_SELF_HOST_PERF: 1} # perf OOM
- {IMPL: java}
- {IMPL: jq}
- {IMPL: js}
- {IMPL: julia}
- {IMPL: kotlin}
- {IMPL: livescript}
- {IMPL: logo, NO_SELF_HOST: 1} # step4 timeout
- {IMPL: lua}
- {IMPL: make, NO_SELF_HOST: 1} # step4 timeout
- {IMPL: mal, MAL_IMPL: js, BUILD_IMPL: js, NO_SELF_HOST: 1}
- {IMPL: mal, MAL_IMPL: js-mal, BUILD_IMPL: js, NO_SELF_HOST: 1, NO_PERF: 1, SLOW: 1}
- {IMPL: mal, MAL_IMPL: nim, BUILD_IMPL: nim, NO_SELF_HOST: 1}
- {IMPL: mal, MAL_IMPL: nim-mal, BUILD_IMPL: nim, NO_SELF_HOST: 1, NO_PERF: 1, SLOW: 1}
- {IMPL: matlab, NO_SELF_HOST_PERF: 1} # Octave, perf timeout
- {IMPL: miniMAL, NO_SELF_HOST_PERF: 1, SLOW: 1} # perf timeout
- {IMPL: nasm, NO_SELF_HOST_PERF: 1} # perf OOM
- {IMPL: nim}
- {IMPL: objpascal}
- {IMPL: objc}
- {IMPL: ocaml}
- {IMPL: perl}
- {IMPL: perl6}
- {IMPL: php}
- {IMPL: picolisp}
- {IMPL: pike}
- {IMPL: plpgsql, NO_SELF_HOST: 1, SLOW: 1} # step3 timeout
# - {IMPL: plsql}
- {IMPL: prolog}
- {IMPL: ps}
- {IMPL: powershell, NO_SELF_HOST_PERF: 1}
- {IMPL: python, python_MODE: python2}
- {IMPL: python, python_MODE: python3}
- {IMPL: python.2}
- {IMPL: r}
- {IMPL: racket}
- {IMPL: rexx}
- {IMPL: rpython, SLOW: 1}
- {IMPL: ruby}
- {IMPL: rust}
- {IMPL: scala}
- {IMPL: scheme, scheme_MODE: chibi}
- {IMPL: scheme, scheme_MODE: kawa}
- {IMPL: scheme, scheme_MODE: gauche}
- {IMPL: scheme, scheme_MODE: chicken}
- {IMPL: scheme, scheme_MODE: sagittarius}
- {IMPL: scheme, scheme_MODE: cyclone}
# - {IMPL: scheme, scheme_MODE: foment}
- {IMPL: skew}
- {IMPL: tcl}
- {IMPL: ts}
- {IMPL: vala}
- {IMPL: vb}
- {IMPL: vhdl, NO_SELF_HOST_PERF: 1} # perf timeout
- {IMPL: vimscript}
# no self-host perf for wasm due to mac stack overflow
- {IMPL: wasm, wasm_MODE: wasmtime, NO_SELF_HOST_PERF: 1, NO_PERF: 1}
- {IMPL: wasm, wasm_MODE: wasmer, NO_SELF_HOST_PERF: 1, NO_PERF: 1}
- {IMPL: wasm, wasm_MODE: lucet, NO_SELF_HOST_PERF: 1, NO_PERF: 1}
- {IMPL: wasm, wasm_MODE: wax, NO_SELF_HOST_PERF: 1}
- {IMPL: wasm, wasm_MODE: node, NO_SELF_HOST_PERF: 1, NO_PERF: 1}
- {IMPL: wasm, wasm_MODE: warpy, NO_SELF_HOST_PERF: 1}
- {IMPL: wasm, wasm_MODE: wace_libc, NO_SELF_HOST_PERF: 1}
- {IMPL: wren}
- {IMPL: xslt}
- {IMPL: yorick}
- {IMPL: zig}
# See .travis.yml (for older osx / xcode tests)
# - {IMPL: objc, NO_DOCKER: 1, OS: xcode7}}
# - {IMPL: swift, NO_DOCKER: 1, OS: xcode7.3}}
# - {IMPL: swift3, NO_DOCKER: 1, OS: xcode8}}
# - {IMPL: swift4, NO_DOCKER: 1, OS: xcode10}}
- {IMPL: swift5, NO_DOCKER: 1, OS: macos}

183
Makefile
View File

@ -43,29 +43,15 @@ all help:
@echo 'make "docker-shell^IMPL" # start bash shell in docker image for IMPL'
@echo
# Implementation specific settings are here:
include Makefile.impls
#
# Command line settings
# General command line settings
#
MAL_IMPL = js
# cbm or qbasic
basic_MODE = cbm
# clj or cljs (Clojure vs ClojureScript/lumo)
clojure_MODE = clj
# gdc, ldc2, or dmd
d_MODE = gdc
# python, js, cpp, or neko
haxe_MODE = neko
# octave or matlab
matlab_MODE = octave
# python, python2 or python3
python_MODE = python
# scheme (chibi, kawa, gauche, chicken, sagittarius, cyclone, foment)
scheme_MODE = chibi
# wasmtime wasmer lucet wax node warpy wace_libc
wasm_MODE = wasmtime
# Path to loccount for counting LOC stats
LOCCOUNT = loccount
@ -86,16 +72,9 @@ DOCKERIZE =
#
# Implementation specific settings
# General settings and utility functions
#
IMPLS = ada ada.2 awk bash basic bbc-basic c chuck clojure coffee common-lisp cpp crystal cs d dart \
elisp elixir elm erlang es6 factor fantom forth fsharp go groovy gnu-smalltalk \
guile haskell haxe hy io java js jq julia kotlin livescript logo lua make mal \
matlab miniMAL nasm nim objc objpascal ocaml perl perl6 php picolisp pike plpgsql \
plsql powershell prolog ps python python.2 r racket rexx rpython ruby rust scala scheme skew \
swift swift3 swift4 swift5 tcl ts vala vb vhdl vimscript wasm wren yorick xslt zig
EXTENSION = .mal
step0 = step0_repl
@ -125,158 +104,6 @@ regress_step8 = $(regress_step7) step8
regress_step9 = $(regress_step8) step9
regress_stepA = $(regress_step9) stepA
step5_EXCLUDES += bash # never completes at 10,000
step5_EXCLUDES += basic # too slow, and limited to ints of 2^16
step5_EXCLUDES += logo # too slow for 10,000
step5_EXCLUDES += make # no TCO capability (iteration or recursion)
step5_EXCLUDES += mal # host impl dependent
step5_EXCLUDES += matlab # never completes at 10,000
step5_EXCLUDES += plpgsql # too slow for 10,000
step5_EXCLUDES += plsql # too slow for 10,000
step5_EXCLUDES += powershell # too slow for 10,000
step5_EXCLUDES += prolog # no iteration (but interpreter does TCO implicitly)
step5_EXCLUDES += $(if $(filter cpp,$(haxe_MODE)),haxe,) # cpp finishes 10,000, segfaults at 100,000
step5_EXCLUDES += xslt # iteration cannot be expressed
dist_EXCLUDES += mal
# TODO: still need to implement dist
dist_EXCLUDES += guile io julia matlab swift
# Extra options to pass to runtest.py
bbc-basic_TEST_OPTS = --test-timeout 60
guile_TEST_OPTS = --test-timeout 120
io_TEST_OPTS = --test-timeout 120
logo_TEST_OPTS = --start-timeout 60 --test-timeout 120
mal_TEST_OPTS = --start-timeout 60 --test-timeout 120
miniMAL_TEST_OPTS = --start-timeout 60 --test-timeout 120
perl6_TEST_OPTS = --test-timeout=60
plpgsql_TEST_OPTS = --start-timeout 60 --test-timeout 180
plsql_TEST_OPTS = --start-timeout 120 --test-timeout 120
vimscript_TEST_OPTS = --test-timeout 30
ifeq ($(MAL_IMPL),vimscript)
mal_TEST_OPTS = --start-timeout 60 --test-timeout 180
else ifeq ($(MAL_IMPL),powershell)
mal_TEST_OPTS = --start-timeout 60 --test-timeout 180
endif
xslt_TEST_OPTS = --test-timeout 120
#
# Implementation specific utility functions
#
basic_STEP_TO_PROG_cbm = impls/basic/$($(1)).bas
basic_STEP_TO_PROG_qbasic = impls/basic/$($(1))
clojure_STEP_TO_PROG_clj = impls/clojure/target/$($(1)).jar
clojure_STEP_TO_PROG_cljs = impls/clojure/src/mal/$($(1)).cljc
haxe_STEP_TO_PROG_neko = impls/haxe/$($(1)).n
haxe_STEP_TO_PROG_python = impls/haxe/$($(1)).py
haxe_STEP_TO_PROG_cpp = impls/haxe/cpp/$($(1))
haxe_STEP_TO_PROG_js = impls/haxe/$($(1)).js
scheme_STEP_TO_PROG_chibi = impls/scheme/$($(1)).scm
scheme_STEP_TO_PROG_kawa = impls/scheme/out/$($(1)).class
scheme_STEP_TO_PROG_gauche = impls/scheme/$($(1)).scm
scheme_STEP_TO_PROG_chicken = impls/scheme/$($(1))
scheme_STEP_TO_PROG_sagittarius = impls/scheme/$($(1)).scm
scheme_STEP_TO_PROG_cyclone = impls/scheme/$($(1))
scheme_STEP_TO_PROG_foment = impls/scheme/$($(1)).scm
# Map of step (e.g. "step8") to executable file for that step
ada_STEP_TO_PROG = impls/ada/$($(1))
ada.2_STEP_TO_PROG = impls/ada.2/$($(1))
awk_STEP_TO_PROG = impls/awk/$($(1)).awk
bash_STEP_TO_PROG = impls/bash/$($(1)).sh
basic_STEP_TO_PROG = $(basic_STEP_TO_PROG_$(basic_MODE))
bbc-basic_STEP_TO_PROG = impls/bbc-basic/$($(1)).bas
c_STEP_TO_PROG = impls/c/$($(1))
chuck_STEP_TO_PROG = impls/chuck/$($(1)).ck
clojure_STEP_TO_PROG = $(clojure_STEP_TO_PROG_$(clojure_MODE))
coffee_STEP_TO_PROG = impls/coffee/$($(1)).coffee
common-lisp_STEP_TO_PROG = impls/common-lisp/$($(1))
cpp_STEP_TO_PROG = impls/cpp/$($(1))
crystal_STEP_TO_PROG = impls/crystal/$($(1))
cs_STEP_TO_PROG = impls/cs/$($(1)).exe
d_STEP_TO_PROG = impls/d/$($(1))
dart_STEP_TO_PROG = impls/dart/$($(1)).dart
elisp_STEP_TO_PROG = impls/elisp/$($(1)).el
elixir_STEP_TO_PROG = impls/elixir/lib/mix/tasks/$($(1)).ex
elm_STEP_TO_PROG = impls/elm/$($(1)).js
erlang_STEP_TO_PROG = impls/erlang/$($(1))
es6_STEP_TO_PROG = impls/es6/$($(1)).mjs
factor_STEP_TO_PROG = impls/factor/$($(1))/$($(1)).factor
fantom_STEP_TO_PROG = impls/fantom/lib/fan/$($(1)).pod
forth_STEP_TO_PROG = impls/forth/$($(1)).fs
fsharp_STEP_TO_PROG = impls/fsharp/$($(1)).exe
go_STEP_TO_PROG = impls/go/$($(1))
groovy_STEP_TO_PROG = impls/groovy/$($(1)).groovy
gnu-smalltalk_STEP_TO_PROG = impls/gnu-smalltalk/$($(1)).st
guile_STEP_TO_PROG = impls/guile/$($(1)).scm
haskell_STEP_TO_PROG = impls/haskell/$($(1))
haxe_STEP_TO_PROG = $(haxe_STEP_TO_PROG_$(haxe_MODE))
hy_STEP_TO_PROG = impls/hy/$($(1)).hy
io_STEP_TO_PROG = impls/io/$($(1)).io
java_STEP_TO_PROG = impls/java/target/classes/mal/$($(1)).class
js_STEP_TO_PROG = impls/js/$($(1)).js
jq_STEP_PROG = impls/jq/$($(1)).jq
julia_STEP_TO_PROG = impls/julia/$($(1)).jl
kotlin_STEP_TO_PROG = impls/kotlin/$($(1)).jar
livescript_STEP_TO_PROG = impls/livescript/$($(1)).js
logo_STEP_TO_PROG = impls/logo/$($(1)).lg
lua_STEP_TO_PROG = impls/lua/$($(1)).lua
make_STEP_TO_PROG = impls/make/$($(1)).mk
mal_STEP_TO_PROG = impls/mal/$($(1)).mal
matlab_STEP_TO_PROG = impls/matlab/$($(1)).m
miniMAL_STEP_TO_PROG = impls/miniMAL/$($(1)).json
nasm_STEP_TO_PROG = impls/nasm/$($(1))
nim_STEP_TO_PROG = impls/nim/$($(1))
objc_STEP_TO_PROG = impls/objc/$($(1))
objpascal_STEP_TO_PROG = impls/objpascal/$($(1))
ocaml_STEP_TO_PROG = impls/ocaml/$($(1))
perl_STEP_TO_PROG = impls/perl/$($(1)).pl
perl6_STEP_TO_PROG = impls/perl6/$($(1)).pl
php_STEP_TO_PROG = impls/php/$($(1)).php
picolisp_STEP_TO_PROG = impls/picolisp/$($(1)).l
pike_STEP_TO_PROG = impls/pike/$($(1)).pike
plpgsql_STEP_TO_PROG = impls/plpgsql/$($(1)).sql
plsql_STEP_TO_PROG = impls/plsql/$($(1)).sql
powershell_STEP_TO_PROG = impls/powershell/$($(1)).ps1
prolog_STEP_TO_PROG = impls/prolog/$($(1)).pl
ps_STEP_TO_PROG = impls/ps/$($(1)).ps
python_STEP_TO_PROG = impls/python/$($(1)).py
python.2_STEP_TO_PROG = impls/python.2/$($(1)).py
r_STEP_TO_PROG = impls/r/$($(1)).r
racket_STEP_TO_PROG = impls/racket/$($(1)).rkt
rexx_STEP_TO_PROG = impls/rexx/$($(1)).rexxpp
rpython_STEP_TO_PROG = impls/rpython/$($(1))
ruby_STEP_TO_PROG = impls/ruby/$($(1)).rb
rust_STEP_TO_PROG = impls/rust/$($(1))
scala_STEP_TO_PROG = impls/scala/target/scala-2.11/classes/$($(1)).class
scheme_STEP_TO_PROG = $(scheme_STEP_TO_PROG_$(scheme_MODE))
skew_STEP_TO_PROG = impls/skew/$($(1)).js
swift_STEP_TO_PROG = impls/swift/$($(1))
swift3_STEP_TO_PROG = impls/swift3/$($(1))
swift4_STEP_TO_PROG = impls/swift4/$($(1))
swift5_STEP_TO_PROG = impls/swift5/$($(1))
tcl_STEP_TO_PROG = impls/tcl/$($(1)).tcl
ts_STEP_TO_PROG = impls/ts/$($(1)).js
vala_STEP_TO_PROG = impls/vala/$($(1))
vb_STEP_TO_PROG = impls/vb/$($(1)).exe
vhdl_STEP_TO_PROG = impls/vhdl/$($(1))
vimscript_STEP_TO_PROG = impls/vimscript/$($(1)).vim
wasm_STEP_TO_PROG = impls/wasm/$($(1)).$(if $(filter lucet,$(wasm_MODE)),so,wasm)
wren_STEP_TO_PROG = impls/wren/$($(1)).wren
yorick_STEP_TO_PROG = impls/yorick/$($(1)).i
xslt_STEP_TO_PROG = impls/xslt/$($(1))
zig_STEP_TO_PROG = impls/zig/$($(1))
#
# General settings and utility functions
#
# Needed some argument munging
COMMA = ,
noop =

188
Makefile.impls Normal file
View File

@ -0,0 +1,188 @@
# HOWTO add a new implementation (named "foo"):
# - Add "foo" to the IMPLS variable (alphabetical order)
# - Add a new "foo_STEP_TO_PROG" variable.
# - Add an "impls/foo/run" script.
# - Add an "impls/foo/Makefile"
# - Add an "impls/foo/Dockerfile"
# - Implement each step in "impls/foo/".
#
# Implementation specific command line settings
#
# cbm or qbasic
basic_MODE = cbm
# clj or cljs (Clojure vs ClojureScript/lumo)
clojure_MODE = clj
# gdc, ldc2, or dmd
d_MODE = gdc
# python, js, cpp, or neko
haxe_MODE = neko
# octave or matlab
matlab_MODE = octave
# python, python2 or python3
python_MODE = python
# scheme (chibi, kawa, gauche, chicken, sagittarius, cyclone, foment)
scheme_MODE = chibi
# wasmtime wasmer lucet wax node warpy wace_libc
wasm_MODE = wasmtime
#
# Implementation specific settings
#
IMPLS = ada ada.2 awk bash basic bbc-basic c chuck clojure coffee common-lisp cpp crystal cs d dart \
elisp elixir elm erlang es6 factor fantom forth fsharp go groovy gnu-smalltalk \
guile haskell haxe hy io janet java js jq julia kotlin livescript logo lua make mal \
matlab miniMAL nasm nim objc objpascal ocaml perl perl6 php picolisp pike plpgsql \
plsql powershell ps python python.2 r racket rexx rpython ruby rust scala scheme skew \
swift swift3 swift4 swift5 tcl ts vala vb vhdl vimscript wasm wren yorick xslt zig
step5_EXCLUDES += bash # never completes at 10,000
step5_EXCLUDES += basic # too slow, and limited to ints of 2^16
step5_EXCLUDES += logo # too slow for 10,000
step5_EXCLUDES += make # no TCO capability (iteration or recursion)
step5_EXCLUDES += mal # host impl dependent
step5_EXCLUDES += matlab # never completes at 10,000
step5_EXCLUDES += plpgsql # too slow for 10,000
step5_EXCLUDES += plsql # too slow for 10,000
step5_EXCLUDES += powershell # too slow for 10,000
step5_EXCLUDES += $(if $(filter cpp,$(haxe_MODE)),haxe,) # cpp finishes 10,000, segfaults at 100,000
step5_EXCLUDES += xslt # iteration cannot be expressed
dist_EXCLUDES += mal
# TODO: still need to implement dist
dist_EXCLUDES += guile io julia matlab swift
# Extra options to pass to runtest.py
bbc-basic_TEST_OPTS = --test-timeout 60
guile_TEST_OPTS = --test-timeout 120
io_TEST_OPTS = --test-timeout 120
logo_TEST_OPTS = --start-timeout 60 --test-timeout 120
mal_TEST_OPTS = --start-timeout 60 --test-timeout 120
miniMAL_TEST_OPTS = --start-timeout 60 --test-timeout 120
perl6_TEST_OPTS = --test-timeout=60
plpgsql_TEST_OPTS = --start-timeout 60 --test-timeout 180
plsql_TEST_OPTS = --start-timeout 120 --test-timeout 120
vimscript_TEST_OPTS = --test-timeout 30
ifeq ($(MAL_IMPL),vimscript)
mal_TEST_OPTS = --start-timeout 60 --test-timeout 180
else ifeq ($(MAL_IMPL),powershell)
mal_TEST_OPTS = --start-timeout 60 --test-timeout 180
endif
xslt_TEST_OPTS = --test-timeout 120
#
# Implementation specific utility functions
#
basic_STEP_TO_PROG_cbm = impls/basic/$($(1)).bas
basic_STEP_TO_PROG_qbasic = impls/basic/$($(1))
clojure_STEP_TO_PROG_clj = impls/clojure/target/$($(1)).jar
clojure_STEP_TO_PROG_cljs = impls/clojure/src/mal/$($(1)).cljc
haxe_STEP_TO_PROG_neko = impls/haxe/$($(1)).n
haxe_STEP_TO_PROG_python = impls/haxe/$($(1)).py
haxe_STEP_TO_PROG_cpp = impls/haxe/cpp/$($(1))
haxe_STEP_TO_PROG_js = impls/haxe/$($(1)).js
scheme_STEP_TO_PROG_chibi = impls/scheme/$($(1)).scm
scheme_STEP_TO_PROG_kawa = impls/scheme/out/$($(1)).class
scheme_STEP_TO_PROG_gauche = impls/scheme/$($(1)).scm
scheme_STEP_TO_PROG_chicken = impls/scheme/$($(1))
scheme_STEP_TO_PROG_sagittarius = impls/scheme/$($(1)).scm
scheme_STEP_TO_PROG_cyclone = impls/scheme/$($(1))
scheme_STEP_TO_PROG_foment = impls/scheme/$($(1)).scm
# Map of step (e.g. "step8") to executable file for that step
ada_STEP_TO_PROG = impls/ada/$($(1))
ada.2_STEP_TO_PROG = impls/ada.2/$($(1))
awk_STEP_TO_PROG = impls/awk/$($(1)).awk
bash_STEP_TO_PROG = impls/bash/$($(1)).sh
basic_STEP_TO_PROG = $(basic_STEP_TO_PROG_$(basic_MODE))
bbc-basic_STEP_TO_PROG = impls/bbc-basic/$($(1)).bas
c_STEP_TO_PROG = impls/c/$($(1))
chuck_STEP_TO_PROG = impls/chuck/$($(1)).ck
clojure_STEP_TO_PROG = $(clojure_STEP_TO_PROG_$(clojure_MODE))
coffee_STEP_TO_PROG = impls/coffee/$($(1)).coffee
common-lisp_STEP_TO_PROG = impls/common-lisp/$($(1))
cpp_STEP_TO_PROG = impls/cpp/$($(1))
crystal_STEP_TO_PROG = impls/crystal/$($(1))
cs_STEP_TO_PROG = impls/cs/$($(1)).exe
d_STEP_TO_PROG = impls/d/$($(1))
dart_STEP_TO_PROG = impls/dart/$($(1)).dart
elisp_STEP_TO_PROG = impls/elisp/$($(1)).el
elixir_STEP_TO_PROG = impls/elixir/lib/mix/tasks/$($(1)).ex
elm_STEP_TO_PROG = impls/elm/$($(1)).js
erlang_STEP_TO_PROG = impls/erlang/$($(1))
es6_STEP_TO_PROG = impls/es6/$($(1)).mjs
factor_STEP_TO_PROG = impls/factor/$($(1))/$($(1)).factor
fantom_STEP_TO_PROG = impls/fantom/lib/fan/$($(1)).pod
forth_STEP_TO_PROG = impls/forth/$($(1)).fs
fsharp_STEP_TO_PROG = impls/fsharp/$($(1)).exe
go_STEP_TO_PROG = impls/go/$($(1))
groovy_STEP_TO_PROG = impls/groovy/$($(1)).groovy
gnu-smalltalk_STEP_TO_PROG = impls/gnu-smalltalk/$($(1)).st
guile_STEP_TO_PROG = impls/guile/$($(1)).scm
haskell_STEP_TO_PROG = impls/haskell/$($(1))
haxe_STEP_TO_PROG = $(haxe_STEP_TO_PROG_$(haxe_MODE))
hy_STEP_TO_PROG = impls/hy/$($(1)).hy
io_STEP_TO_PROG = impls/io/$($(1)).io
janet_STEP_TO_PROG = impls/janet/$($(1)).janet
java_STEP_TO_PROG = impls/java/target/classes/mal/$($(1)).class
js_STEP_TO_PROG = impls/js/$($(1)).js
jq_STEP_PROG = impls/jq/$($(1)).jq
julia_STEP_TO_PROG = impls/julia/$($(1)).jl
kotlin_STEP_TO_PROG = impls/kotlin/$($(1)).jar
livescript_STEP_TO_PROG = impls/livescript/$($(1)).js
logo_STEP_TO_PROG = impls/logo/$($(1)).lg
lua_STEP_TO_PROG = impls/lua/$($(1)).lua
make_STEP_TO_PROG = impls/make/$($(1)).mk
mal_STEP_TO_PROG = impls/mal/$($(1)).mal
matlab_STEP_TO_PROG = impls/matlab/$($(1)).m
miniMAL_STEP_TO_PROG = impls/miniMAL/$($(1)).json
nasm_STEP_TO_PROG = impls/nasm/$($(1))
nim_STEP_TO_PROG = impls/nim/$($(1))
objc_STEP_TO_PROG = impls/objc/$($(1))
objpascal_STEP_TO_PROG = impls/objpascal/$($(1))
ocaml_STEP_TO_PROG = impls/ocaml/$($(1))
perl_STEP_TO_PROG = impls/perl/$($(1)).pl
perl6_STEP_TO_PROG = impls/perl6/$($(1)).pl
php_STEP_TO_PROG = impls/php/$($(1)).php
picolisp_STEP_TO_PROG = impls/picolisp/$($(1)).l
pike_STEP_TO_PROG = impls/pike/$($(1)).pike
plpgsql_STEP_TO_PROG = impls/plpgsql/$($(1)).sql
plsql_STEP_TO_PROG = impls/plsql/$($(1)).sql
powershell_STEP_TO_PROG = impls/powershell/$($(1)).ps1
ps_STEP_TO_PROG = impls/ps/$($(1)).ps
python_STEP_TO_PROG = impls/python/$($(1)).py
python.2_STEP_TO_PROG = impls/python.2/$($(1)).py
r_STEP_TO_PROG = impls/r/$($(1)).r
racket_STEP_TO_PROG = impls/racket/$($(1)).rkt
rexx_STEP_TO_PROG = impls/rexx/$($(1)).rexxpp
rpython_STEP_TO_PROG = impls/rpython/$($(1))
ruby_STEP_TO_PROG = impls/ruby/$($(1)).rb
rust_STEP_TO_PROG = impls/rust/$($(1))
scala_STEP_TO_PROG = impls/scala/target/scala-2.11/classes/$($(1)).class
scheme_STEP_TO_PROG = $(scheme_STEP_TO_PROG_$(scheme_MODE))
skew_STEP_TO_PROG = impls/skew/$($(1)).js
swift_STEP_TO_PROG = impls/swift/$($(1))
swift3_STEP_TO_PROG = impls/swift3/$($(1))
swift4_STEP_TO_PROG = impls/swift4/$($(1))
swift5_STEP_TO_PROG = impls/swift5/$($(1))
tcl_STEP_TO_PROG = impls/tcl/$($(1)).tcl
ts_STEP_TO_PROG = impls/ts/$($(1)).js
vala_STEP_TO_PROG = impls/vala/$($(1))
vb_STEP_TO_PROG = impls/vb/$($(1)).exe
vhdl_STEP_TO_PROG = impls/vhdl/$($(1))
vimscript_STEP_TO_PROG = impls/vimscript/$($(1)).vim
wasm_STEP_TO_PROG = impls/wasm/$($(1)).$(if $(filter lucet,$(wasm_MODE)),so,wasm)
wren_STEP_TO_PROG = impls/wren/$($(1)).wren
yorick_STEP_TO_PROG = impls/yorick/$($(1)).i
xslt_STEP_TO_PROG = impls/xslt/$($(1))
zig_STEP_TO_PROG = impls/zig/$($(1))

View File

@ -43,7 +43,7 @@ mode_val=${!mode_var}
MAKE="make ${mode_val:+${mode_var}=${mode_val}}"
# If NO_DOCKER is blank then launch use a docker image, otherwise use
# the Travis image/tools directly.
# the Travis/Github Actions image/tools directly.
if [ -z "${NO_DOCKER}" ]; then
img_impl=$(echo "${MAL_IMPL:-${IMPL}}" | tr '[:upper:]' '[:lower:]')
# We could just use make DOCKERIZE=1 instead but that does add

View File

@ -164,10 +164,10 @@ into the main repository:
make DOCKERIZE=1 MAL_IMPL=[IMPL_NAME] "test^mal"
```
* Make sure the Travis build and test scripts pass locally:
* Make sure the CI build and test scripts pass locally:
```bash
./.travis_test.sh build [IMPL_NAME]
./.travis_test.sh test [IMPL_NAME]
./ci.sh build [IMPL_NAME]
./ci.sh test [IMPL_NAME]
```
* If you are creating a new implementation for an existing

52
get-ci-matrix.py Executable file
View File

@ -0,0 +1,52 @@
#!/usr/bin/env python3
import json
import re
import sys
import yaml
IMPLS_FILE = "IMPLS.yml"
RE_IGNORE = re.compile(r'(^LICENSE$|^README.md$|^docs/|^process/)')
RE_IMPL = re.compile(r'^impls/(?!lib|tests)([^/]*)/')
def impl_text(impl):
s = "IMPL=%s" % impl['IMPL']
for k, v in impl.items():
if k == 'IMPL': continue
s += " %s=%s" % (k, v)
return s
all_changes = sys.argv[1:]
# code changes that are not just to docs
code_changes = set([c for c in all_changes if not RE_IGNORE.search(c)])
# actual changes to implementations
impl_changes = set([c for c in all_changes if RE_IMPL.search(c)])
# names of changed implementations
changed_impls = set([RE_IMPL.search(c).groups()[0] for c in impl_changes])
# If we have non-implementation code changes then we will add all
# implementations to the test matrix
do_full = (len(code_changes) != len(impl_changes))
print("code_changes: %s (%d)" % (code_changes, len(code_changes)))
print("impl_changes: %s (%d)" % (impl_changes, len(impl_changes)))
print("changed_impls: %s (%d)" % (changed_impls, len(changed_impls)))
print("do_full: %s" % do_full)
# Load the full implementation description file
all_impls = yaml.safe_load(open(IMPLS_FILE))
# Accumulate and output linux and macos implementations separately
linux_impls = []
macos_impls = []
for impl in all_impls['IMPL']:
if do_full or impl['IMPL'] in changed_impls:
if 'OS' in impl and impl['OS'] == 'macos':
macos_impls.append(impl_text(impl))
else:
linux_impls.append(impl_text(impl))
print("::set-output name=do-linux::%s" % json.dumps(len(linux_impls)>0))
print("::set-output name=do-macos::%s" % json.dumps(len(macos_impls)>0))
print("::set-output name=linux::{\"IMPL\":%s}" % json.dumps(linux_impls))
print("::set-output name=macos::{\"IMPL\":%s}" % json.dumps(macos_impls))