Skip to content

Commit

Permalink
Remove the implementations folder since it is not maintained (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr authored Feb 3, 2024
2 parents c3aecc5 + ae34547 commit 329686c
Show file tree
Hide file tree
Showing 60 changed files with 289 additions and 981 deletions.
105 changes: 58 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,38 @@ jobs:
fail-fast: false
matrix:
include:
- name: Java
id: java
- { name: Java, id: java, folder: Java }
- { name: SOM, id: som, folder: SOM }
- { name: Crystal, id: crystal, folder: Crystal }
- { name: JavaScript, id: js, folder: JavaScript }
- { name: SOMns, id: somns, folder: SOMns }

- name: SOM
id: som
#- { name: Pharo, id: pharo, folder: Smalltalk }

- name: Crystal
id: crystal

- name: JavaScript
id: js

- name: SOMns
id: somns

# - name: Pharo
# id: pharo

- name: Squeak 64-bit
id: squeak64

- name: Ruby
id: ruby

- name: Lua 5.2
id: lua52

- name: Python
id: python
- { name: Squeak, id: squeak, folder: Smalltalk }
- { name: Ruby, id: ruby, folder: Ruby }
- { name: Lua, id: lua, folder: Lua }
- { name: Python, id: python, folder: Python }

name: ${{ matrix.name }}
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.11"

- name: Checkout AWFY Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install ReBench
run: |
python -m pip install ReBench
- name: Install asdf and asdf-awfy
run: |
git clone --depth 1 https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
~/.asdf/bin/asdf plugin add awfy https://github.com/smarr/asdf-awfy.git
if: matrix.id == 'squeak'

- name: Install Crystal
if: matrix.id == 'crystal'
uses: oprypin/install-crystal@v1
Expand All @@ -67,17 +56,13 @@ jobs:
with:
smalltalk-image: Pharo64-stable

- name: Install Squeak64
if: matrix.id == 'squeak64'
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: Squeak64-5.2

- name: Install Squeak32
if: matrix.id == 'squeak32'
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: Squeak32-5.2
- name: Install Squeak
if: matrix.id == 'squeak'
run: |
~/.asdf/bin/asdf install awfy squeak-6.0-22148
cp ~/.asdf/installs/awfy/squeak-6.0-22148/shared/SqueakV60.sources benchmarks/Smalltalk/
cp ~/.asdf/installs/awfy/squeak-6.0-22148/shared/Squeak*.image benchmarks/Smalltalk/Squeak.image
cp ~/.asdf/installs/awfy/squeak-6.0-22148/shared/Squeak*.changes benchmarks/Smalltalk/Squeak.changes
- name: Install Ruby
if: matrix.id == 'ruby'
Expand All @@ -87,24 +72,50 @@ jobs:
- name: Install Lua
uses: leafo/gh-actions-lua@v10
with:
luaVersion: 5.2
if: matrix.id == 'lua52'
luaVersion: 5.2
if: matrix.id == 'lua'

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v4
if: matrix.id == 'lua52'
if: matrix.id == 'lua'

- name: Install LuaCheck and lua5.2 symlink
run: |
luarocks install luacheck
(cd .lua/bin && ln -s lua lua5.2)
if: matrix.id == 'lua52'
if: matrix.id == 'lua'

- name: Install Python
run: |
python -m pip install pylint
if: matrix.id == 'python'

- name: Install SOM
run: |
source benchmarks/script.inc
load_git_repo https://github.com/SOM-st/som-java.git SOM
pushd SOM
git submodule update --recursive --init
ant
popd
load_git_repo https://github.com/SOM-st/TruffleSOM.git TruffleSOM
pushd TruffleSOM
git submodule update --recursive --init
./som --setup mx
./som --setup labsjdk
../mx/mx build
if: matrix.id == 'som'

- name: Install SOMns
run: |
source benchmarks/script.inc
load_git_repo https://github.com/smarr/SOMns.git SOMns
pushd SOMns
git submodule update --recursive --init
ant compile
if: matrix.id == 'somns'

- name: Python Black Style Check
uses: psf/black@stable
with:
Expand All @@ -114,12 +125,12 @@ jobs:

- name: Build
run: |
implementations/build-${{ matrix.id }}.sh
benchmarks/${{ matrix.folder }}/build.sh ${{ matrix.id }}
- name: ReBench Test Run
run: |
rebench test.conf test-${{ matrix.id }}
- name: Style Check
run: |
implementations/build-${{ matrix.id }}.sh style skip-black-for-python
benchmarks/${{ matrix.folder }}/build.sh style skip-black-for-python
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.html
.Rhistory
.idea
.vscode
.eclipse-ws
benchmarks.jar
benchmark.data
Expand Down
14 changes: 11 additions & 3 deletions benchmarks/Crystal/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash
set -e
SCRIPT_PATH=`dirname $0`
pushd $SCRIPT_PATH
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

if [[ "$1" = "style" ]]
then
exit 0
fi

INFO Build Crystal Benchmarks
pushd "$SCRIPT_PATH"
crystal build --release --no-debug harness.cr
13 changes: 13 additions & 0 deletions benchmarks/Java/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"
pushd "$SCRIPT_PATH"

if [[ "$1" = "style" ]]
then
ant checkstyle-jar && ant checkstyle
else
INFO Build Java Benchmarks
ant jar
fi
14 changes: 14 additions & 0 deletions benchmarks/JavaScript/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

INFO Build Node.js Benchmarks
if [[ "$1" = "style" ]]
then
INFO Check style of JavaScript benchmarks
pushd "$SCRIPT_PATH"
npx eslint .
else
exit 0
fi
13 changes: 13 additions & 0 deletions benchmarks/Lua/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source $SCRIPT_PATH/../script.inc

if [[ "$1" = "style" ]]
then
INFO Check style of Lua benchmarks
pushd "$SCRIPT_PATH"
luacheck ./*.lua
else
exit 0
fi
10 changes: 5 additions & 5 deletions implementations/build-python.sh → benchmarks/Python/build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=`dirname $0`
source $SCRIPT_PATH/script.inc
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

if [ "$1" = "style" ]
if [[ "$1" = "style" ]]
then
INFO Check style of Python benchmarks
pushd $SCRIPT_PATH/../benchmarks/Python
pushd "$SCRIPT_PATH"
if [[ "$2" != "skip-black-for-python" ]]; then
python -m black --check --diff .
fi
python -m pylint *.py som
python -m pylint ./*.py som
else
exit 0
fi
8 changes: 4 additions & 4 deletions implementations/build-ruby.sh → benchmarks/Ruby/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=`dirname $0`
source $SCRIPT_PATH/script.inc
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

if [ "$1" = "style" ]
if [[ "$1" = "style" ]]
then
INFO Check style of Ruby benchmarks
pushd $SCRIPT_PATH/../benchmarks/Ruby
pushd "$SCRIPT_PATH"
rubocop
else
exit 0
Expand Down
11 changes: 11 additions & 0 deletions benchmarks/SOM/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

if [[ "$1" = "style" ]]
then
exit 0
else
exit 0
fi
11 changes: 11 additions & 0 deletions benchmarks/SOMns/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

if [[ "$1" = "style" ]]
then
exit 0
else
exit 0
fi
2 changes: 1 addition & 1 deletion benchmarks/Smalltalk/build-image-squeak.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ FileStream stdout nextPutAll: '== Save and Exit'; cr.
PreferenceWizardMorph allInstances do: #delete.
SystemWindow allSubInstances do: #delete.

Smalltalk saveAs: 'AWFY'] on: Error do: [:e |
Smalltalk saveAs: 'AWFY_Squeak'] on: Error do: [:e |
FileStream stdout nextPutAll: e printString.
].

Expand Down
31 changes: 31 additions & 0 deletions benchmarks/Smalltalk/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname "$0")"
source "$SCRIPT_PATH/../script.inc"

if [[ "$1" = "style" ]]
then
exit 0
elif [[ "$1" == "squeak" ]]
then
pushd "$SCRIPT_PATH"
if [[ ! -f "Squeak.image" ]]
then
ERR "Squeak.image is needed but not found."
ERR "Please copy a Squeak.image, Squeak.changes and the corresponding *.sources file to this directory."
exit 1
fi
~/.asdf/installs/awfy/squeak-6.0-22148/bin/squeak -headless Squeak.image build-image-squeak.st
elif [[ "$1" == "pharo" ]]
then
pushd "$SCRIPT_PATH"
if [[ ! -f "Pharo.image" ]]
then
ERR "Pharo.image is needed but not found."
ERR "Please copy a Pharo.image, Pharo.changes and the corresponding *.sources file to this directory."
exit 1
fi
~/.asdf/installs/awfy/pharo-120/bin/pharo Pharo.image build-image.st
else
exit 0
fi
53 changes: 53 additions & 0 deletions benchmarks/script.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# make SCRIPT_PATH absolute
pushd "$(dirname "$0")" > /dev/null || exit 1
export SCRIPT_PATH="$(pwd)"
popd > /dev/null || exit 1

# set up color commands
if [ -t 1 ] && [ -t 2 ] && [ \( "$(type -t tput)" = "file" \) ]; then
_colors=$(tput colors)
if [ "$_colors" -ge 256 ]; then
INFO () { tput setaf 33; /bin/echo "$@"; tput sgr0; }
OK () { tput setaf 28; /bin/echo "$@"; tput sgr0; }
WARN () { tput setaf 226; /bin/echo "$@"; tput sgr0; }
ERR () { tput setaf 196; /bin/echo "$@"; tput sgr0; }
else
INFO () { tput setaf 4; /bin/echo "$@"; tput sgr0; }
OK () { tput setaf 2; /bin/echo "$@"; tput sgr0; }
WARN () { tput setaf 3; /bin/echo "$@"; tput sgr0; }
ERR () { tput setaf 1; /bin/echo "$@"; tput sgr0; }
fi
else
INFO () { /bin/echo "$@"; }
OK () { /bin/echo "$@"; }
WARN () { /bin/echo "$@"; }
ERR () { /bin/echo "$@"; }
fi

function load_git_repo() {
INFO Cloning "$1" into "$2"
if [[ -z "$3" ]]
then
git clone --depth=1 "$1" "$2"
else
INFO Using Branch "$3"
git clone --branch="$3" --depth=1 "$1" "$2"
fi
}

function load_submodule() {
ERR Submodules are not longer used. Please replace the use of "$1" with load_git_repo for the relevant repo and branch.
}

function check_for() {
if [ ! -x "$(which "$1")" ]
then
ERR "$1 binary not found. $2"
if [ "non-fatal" != "$3" ]
then
exit 1
fi
fi
}
6 changes: 0 additions & 6 deletions implementations/SOMns-e.sh

This file was deleted.

Loading

0 comments on commit 329686c

Please sign in to comment.