Skip to content

Commit

Permalink
Move all build instructions to a build.sh in the language-specific fo…
Browse files Browse the repository at this point in the history
…lder

Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Feb 3, 2024
1 parent c3aecc5 commit 603e411
Show file tree
Hide file tree
Showing 47 changed files with 90 additions and 375 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@ jobs:
matrix:
include:
- name: Java
id: java
id: java

- name: SOM
id: som
id: som

- name: Crystal
id: crystal
id: crystal

- name: JavaScript
id: js
id: js

- name: SOMns
id: somns
id: somns

# - name: Pharo
# id: pharo

- name: Squeak 64-bit
id: squeak64
id: squeak64

- name: Ruby
id: ruby
id: ruby

- name: Lua 5.2
id: lua52
id: lua

- name: Python
id: python
id: python

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

- name: Checkout AWFY Repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Install Lua
uses: leafo/gh-actions-lua@v10
with:
luaVersion: 5.2
luaVersion: 5.2
if: matrix.id == 'lua52'

- name: Install LuaRocks
Expand All @@ -114,12 +114,12 @@ jobs:

- name: Build
run: |
implementations/build-${{ matrix.id }}.sh
benchmarks/${{ matrix.id }}/build.sh
- 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.id }}/build.sh style skip-black-for-python
12 changes: 10 additions & 2 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`
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
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
23 changes: 3 additions & 20 deletions implementations/script.inc → benchmarks/script.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# make SCRIPT_PATH absolute
pushd `dirname $0` > /dev/null
pushd $(dirname $0) > /dev/null
SCRIPT_PATH=`pwd`
popd > /dev/null

Expand Down Expand Up @@ -55,7 +55,7 @@ function check_for_tools() {
function get_pypy() {
if [ \! -d pypy ]; then
get_web_getter

INFO Get PyPy Source
PYPY_VERSION="5.8.0"
PYPY_DIR="pypy2-v${PYPY_VERSION}-src"
Expand All @@ -73,7 +73,7 @@ function get_jdk9ea() {
JDK_ARCHIVE=jdk-9-ea+96_linux-x64_bin.tar.gz
JDK_URL=http://www.java.net/download/jdk9/archive/96/binaries/$JDK_ARCHIVE
JDK_DIR=jdk-9

INFO Get JDK9 Early Access from $JDK_URL
if [ \! -d "$JDK_DIR" ]; then
$GET $JDK_URL || $GET $JDK_URL
Expand Down Expand Up @@ -109,20 +109,3 @@ function check_for() {
fi
fi
}

function check_for_crystal() {
check_for "crystal" "Please see http://crystal-lang.org/docs/installation/index.html" "$1"
}

function check_for_node() {
check_for "node" "Please see https://nodejs.org/en/download/" "$1"
}

function check_for_graalvm() {
if [ ! -x "$SCRIPT_PATH/graalvm/jre/bin/javao" ]
then
ERR "GraalVM not found."
ERR "To run benchmarks on the GraalVM, please see 'implementations/graalvm/README.md'"
fi
}

6 changes: 0 additions & 6 deletions implementations/SOMns-e.sh

This file was deleted.

6 changes: 0 additions & 6 deletions implementations/TruffleSOM-TOM-e.sh

This file was deleted.

6 changes: 0 additions & 6 deletions implementations/TruffleSOM-TOM.sh

This file was deleted.

6 changes: 0 additions & 6 deletions implementations/TruffleSOM-e.sh

This file was deleted.

6 changes: 0 additions & 6 deletions implementations/TruffleSOM.sh

This file was deleted.

15 changes: 0 additions & 15 deletions implementations/build-crystal.sh

This file was deleted.

9 changes: 0 additions & 9 deletions implementations/build-csom.sh

This file was deleted.

45 changes: 0 additions & 45 deletions implementations/build-graal.sh

This file was deleted.

13 changes: 0 additions & 13 deletions implementations/build-java.sh

This file was deleted.

16 changes: 0 additions & 16 deletions implementations/build-jruby.sh

This file was deleted.

16 changes: 0 additions & 16 deletions implementations/build-js.sh

This file was deleted.

9 changes: 0 additions & 9 deletions implementations/build-lua52.sh

This file was deleted.

2 changes: 1 addition & 1 deletion implementations/build-python.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=`dirname $0`
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/script.inc

if [ "$1" = "style" ]
Expand Down
4 changes: 2 additions & 2 deletions implementations/build-rtrufflesom.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=`dirname $0`
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/script.inc
source $SCRIPT_PATH/config.inc

Expand All @@ -15,7 +15,7 @@ else
make clean
make -j4 RTruffleSOM-jit RTruffleSOM-no-jit
popd

load_submodule $SCRIPT_PATH/TruffleSOM-TOM
pushd $SCRIPT_PATH/TruffleSOM-TOM
make clean; make
Expand Down
Loading

0 comments on commit 603e411

Please sign in to comment.