Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolpa committed Jun 1, 2019
0 parents commit 323b1cc
Show file tree
Hide file tree
Showing 6 changed files with 2,338 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM oracle/graalvm-ce

RUN gu install -u https://www.hpi.uni-potsdam.de/hirschfeld/artefacts/graalsqueak/graalsqueak-component-0.8.2-for-19.0.0.jar

RUN yum install -y xorg-x11-server-Xvfb libXrender libXtst x11vnc

ENV DISPLAY=:0

LABEL "com.github.actions.name"="Test Graalsqueak"
LABEL "com.github.actions.description"="Run tests from graalsqueak"
LABEL "com.github.actions.icon"="terminal"
LABEL "com.github.actions.color"="purple"

ADD entrypoint.sh /entrypoint.sh
ADD smalltalkCI /smalltalkCI
ADD graalsqueak-0.8 /graalsqueak-0.8

ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -l
Xvfb -screen 0 800x600x16 -ac &
cd $GITHUB_WORKSPACE
/smalltalkCI/run.sh
2,239 changes: 2,239 additions & 0 deletions graalsqueak-0.8/SqueakV50.sources

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions graalsqueak-0.8/graalsqueak-0.8.changes

Large diffs are not rendered by default.

Binary file added graalsqueak-0.8/graalsqueak-0.8.image
Binary file not shown.
76 changes: 76 additions & 0 deletions smalltalkCI/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
readonly ANSI_BOLD="\033[1m"
readonly ANSI_RED="\033[31m"
readonly ANSI_GREEN="\033[32m"
readonly ANSI_YELLOW="\033[33m"
readonly ANSI_BLUE="\033[34m"
readonly ANSI_RESET="\033[0m"
readonly ANSI_CLEAR="\033[0K"


################################################################################
# Run a .st script located in $SMALLTALK_CI_BUILD
################################################################################
run_script() {
local script="/smalltalkCI/build/$1"
local vm_flags="--squeaksmalltalk.Headless=true"
local resolved_vm="/opt/graalvm-ce-19.0.0/bin/graalsqueak"
local resolved_image="/graalsqueak-0.8/graalsqueak-0.8.image"

"${resolved_vm}" ${vm_flags} "${resolved_image}" "${script}"
}

################################################################################
# Ensure smalltalkCI is loaded and test project.
################################################################################
test_project() {
cat >"/smalltalkCI/build/test.st" <<EOL
| smalltalkCI |
smalltalkCI := Smalltalk at: #SmalltalkCI.
smalltalkCI load: '${GITHUB_WORKSPACE}/.smalltalk.ston'.
smalltalkCI test: '${GITHUB_WORKSPACE}/.smalltalk.ston'.
smalltalkCI quitImage
EOL

run_script "test.st"

printf "\n\n"
}

is_file() {
local file=$1

[[ -f $file ]]
}

print_error() {
printf "${ANSI_BOLD}${ANSI_RED}%s${ANSI_RESET}\n" "$1" 1>&2
}

print_error_and_exit() {
print_error "$1"
exit "${2:-1}" # 2nd parameter, 1 if not set
}

signals_error() {
[[ $1 != "[success]" ]]
}

finalize() {
local build_status

if ! is_file "/graalsqueak-0.8/build_status.txt"; then
print_error_and_exit "Build was unable to report final build status."
fi
build_status=$(cat "/graalsqueak-0.8/build_status.txt")
if signals_error "${build_status}"; then
if [[ "${build_status}" != "[test failure]" ]]; then
print_error_and_exit "${build_status}"
fi
exit 1
else
exit 0
fi
}

test_project
finalize

0 comments on commit 323b1cc

Please sign in to comment.