Skip to content

Commit

Permalink
Update CI and Benchmarking Setup (#14)
Browse files Browse the repository at this point in the history
 - move to GitHub Actions, remove Travis CI
 - use matrix setup in GitLab CI
 - update README
 - update Xcode project
  • Loading branch information
smarr authored Jul 5, 2024
2 parents 88c59fd + 253c383 commit d60308e
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 196 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Tests

on: [push, pull_request]

jobs:
test_soms:
runs-on: ubuntu-22.04
# continue-on-error: true
strategy:
fail-fast: false # we want all jobs to run, because they may fail independently
matrix:
compiler: [clang, gcc]
gc: [GENERATIONAL, MARK_SWEEP, COPYING]
integers:
- "-DUSE_TAGGING=true"
- "-DUSE_TAGGING=false -DCACHE_INTEGER=true"
- "-DUSE_TAGGING=false -DCACHE_INTEGER=false"

steps:
- name: Checkout SOM Repository
uses: actions/checkout@v4
with:
submodules: true

- name: Install Apt Packages
run: |
sudo apt-get install libcppunit-dev
- name: Build SOM VM
run: |
if [ "${{ matrix.compiler }}" = "clang" ]
then
export CC=clang
export CXX=clang++
else
export CC=gcc
export CXX=g++
fi
echo $CC $CXX
echo cmake . -DGC_TYPE=${{ matrix.gc}} ${{ matrix.integers }}
mkdir cmake-build
cd cmake-build
cmake .. -DGC_TYPE=${{ matrix.gc}} ${{ matrix.integers }}
make
- name: Run Unit Tests
run: |
cd cmake-build
./unittests -cp ../Smalltalk:../TestSuite/BasicInterpreterTests ../Examples/Hello.som
- name: Run Tests on SOM VM
run: |
cd cmake-build
./SOM++ -cp ../Smalltalk ../TestSuite/TestHarness.som
# TODO: enable after updating the core-lib
# - name: Test SomSom
# run: |
# cd cmake-build
# ./SOM++ -cp ../Smalltalk:../TestSuite:../core-lib/SomSom/src/compiler:../core-lib/SomSom/src/interpreter:../core-lib/SomSom/src/primitives:../core-lib/SomSom/src/vm:../core-lib/SomSom/src/vmobjects ../core-lib/SomSom/tests/SomSomTests.som
95 changes: 55 additions & 40 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,71 @@ variables:
before_script:
- git submodule update --init

.build_and_test_job: &BUILD_AND_TEST
build_and_test:
stage: build-and-test
tags: [benchmarks, infinity]
script:
- cmake . $CONF
- make
- ./SOM++ -cp ./Smalltalk ./TestSuite/TestHarness.som
- ./unittests -cp ./Smalltalk:./TestSuite/BasicInterpreterTests ./Examples/Hello.som

- rebench --experiment="CI ID $CI_PIPELINE_ID" --branch="$CI_COMMIT_REF_NAME" -c rebench.conf all "e:${NAME}"

tagging_gen:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=true -DGC_TYPE=GENERATIONAL", NAME: tag-gen}

tagging_marksweep:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=true -DGC_TYPE=MARK_SWEEP", NAME: tag-mark}
parallel:
matrix:
- MACHINE:
- yuria
- yuria2
- yuria3
COMPILER: [clang]
GC: [COPYING]
INTEGERS:
- "-DUSE_TAGGING=true"
- "-DUSE_TAGGING=false -DCACHE_INTEGER=true"
- "-DUSE_TAGGING=false -DCACHE_INTEGER=false"

tagging_copying:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=true -DGC_TYPE=COPYING", NAME: tag-copy}
# Track GCC only for one configuration
- MACHINE: [yuria, yuria2, yuria3]
COMPILER: [gcc]
GC: [COPYING]
INTEGERS: ["-DUSE_TAGGING=true"]

boxed_generational_cached:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=false -DGC_TYPE=GENERATIONAL -DCACHE_INTEGER=true", NAME: gen-cache}
# Generational GC is broken it seems, use a configuration that mostly works
- MACHINE: [yuria, yuria2, yuria3]
COMPILER: [clang]
GC: [GENERATIONAL]
INTEGERS: ["-DUSE_TAGGING=false -DCACHE_INTEGER=false"]

boxed_mark_sweep_cached:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=false -DGC_TYPE=MARK_SWEEP -DCACHE_INTEGER=true", NAME: mark-cache}
# Mark-Sweep working, but not super exciting
- MACHINE: [yuria, yuria2, yuria3]
COMPILER: [gcc]
GC: [MARK_SWEEP]
INTEGERS: ["-DUSE_TAGGING=true"]

boxed_copying_cached:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=false -DGC_TYPE=COPYING -DCACHE_INTEGER=true", NAME: copy-cache}

boxed_generational_uncached:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=false -DGC_TYPE=GENERATIONAL -DCACHE_INTEGER=false", NAME: gen}
tags: [$MACHINE]
script:
- rm -rf cmake-build && mkdir cmake-build
- if [ "$COMPILER" = "gcc" ]; then export CC=gcc-13; export CXX=g++-13; fi
- if [ "$COMPILER" = "clang" ]; then export CC=clang-17; export CXX=clang++-17; fi

boxed_mark_sweep_uncached:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=false -DGC_TYPE=MARK_SWEEP -DCACHE_INTEGER=false", NAME: mark}
# compose a name for this configuration
- |+
export NAME="som-$COMPILER-$GC"
if [[ $INTEGERS =~ "USE_TAGGING=true" ]]; then
NAME="$NAME-inttag"
else
NAME="$NAME-intbox"
fi
if [[ $INTEGERS =~ "CACHE_INTEGER=true" ]]; then
NAME="$NAME-intcache"
fi
NAME=`echo "$NAME" | tr '[:upper:]' '[:lower:]'`
boxed_copying_uncached:
<<: *BUILD_AND_TEST
variables: {CONF: "-DUSE_TAGGING=false -DGC_TYPE=COPYING -DCACHE_INTEGER=false", NAME: copy}
- cd cmake-build
- cmake .. $INTEGERS -DGC_TYPE=$GC
- make
- ./SOM++ -cp ../Smalltalk ../TestSuite/TestHarness.som
- ./unittests -cp ../Smalltalk:../TestSuite/BasicInterpreterTests ../Examples/Hello.som
- mv SOM++ ../$NAME
- cd ..

# run the benchmarks
- rebench --experiment="CI ID $CI_PIPELINE_ID" --branch="$CI_COMMIT_REF_NAME" -c rebench.conf all "e:${NAME}" "m:$MACHINE"

complete_benchmarking:
stage: benchmark-completion
tags: [benchmarks, infinity]
tags: [yuria3]
script:
- rebench --experiment="CI ID $CI_PIPELINE_ID" --report-completion rebench.conf
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ set(CMAKE_CXX_STANDARD 14)

set(ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(SRC_DIR "${ROOT_DIR}/src")
set(COMPILER_DIR "${SRC_DIR}/compiler")
set(INTERPRETER_DIR "${SRC_DIR}/interpreter")
set(MEMORY_DIR "${SRC_DIR}/memory")
set(COMPILER_DIR "${SRC_DIR}/compiler")
set(INTERPRETER_DIR "${SRC_DIR}/interpreter")
set(MEMORY_DIR "${SRC_DIR}/memory")
set(MISC_DIR "${SRC_DIR}/misc")
set(VM_DIR "${SRC_DIR}/vm")
set(VMOBJECTS_DIR "${SRC_DIR}/vmobjects")
set(UNITTEST_DIR "${SRC_DIR}/unitTests")
set(VMOBJECTS_DIR "${SRC_DIR}/vmobjects")
set(UNITTEST_DIR "${SRC_DIR}/unitTests")

set(PRIMITIVES_DIR "${SRC_DIR}/primitives")
set(PRIMITIVESCORE_DIR "${SRC_DIR}/primitivesCore")
set(PRIMITIVES_DIR "${SRC_DIR}/primitives")
set(PRIMITIVESCORE_DIR "${SRC_DIR}/primitivesCore")

file(GLOB COMPILER_SRC ${COMPILER_DIR}/*.cpp)
file(GLOB INTERPRETER_SRC ${INTERPRETER_DIR}/*.cpp)
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ implementation of the SOM standard library and a number of examples. Please see
the [main project page][SOMst] for links to the VM implementations.


SOM++ can be built with Make:
SOM++ uses CMake for building:

$ mkdir cmake-build && cd cmake-build
$ cmake ..
$ make

Afterwards, the tests can be executed with:

$ ./SOM++ -cp Smalltalk TestSuite/TestHarness.som
$ ./SOM++ -cp ../Smalltalk ../TestSuite/TestHarness.som

A simple Hello World program is executed with:

$ ./SOM++ -cp Smalltalk Examples/Hello.som
$ ./SOM++ -cp ../Smalltalk ../Examples/Hello.som

**Note**: On Linux, the library search path needs to be adapted:

Expand All @@ -64,20 +66,21 @@ Tagged integers:

default: off
option name: TAGGING
example: make TAGGING=true
example: cmake .. -DUSE_TAGGING=true

Integer caching:

default: off
option name: INT_CACHE
example: make INT_CACHE=true
example: cmake .. -DCACHE_INTEGER=true


Build Status
------------

Thanks to Travis CI, all commits of this repository are tested.
The current build status is: [![Build Status](https://travis-ci.org/SOM-st/SOMpp.png?branch=master)](https://travis-ci.org/SOM-st/SOMpp/)
Thanks to GitHub Actions, all commits of this repository are tested.
The current build status is: [![Build Status](https://github.com/SOM-st/SOMpp/actions/workflows/ci.yml/badge.svg)](https://github.com/SOM-st/SOMpp/actions/workflows/ci.yml)

[SOM]: http://www.hpi.uni-potsdam.de/hirschfeld/projects/som/
[SOMst]: https://travis-ci.org/SOM-st/
[SOMst]: https://som-st.github.io

Loading

0 comments on commit d60308e

Please sign in to comment.