Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: using new JRE capabilities of adoptium aqa-tests #11

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
20 changes: 10 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
java-version: ${{ matrix.jdkver || env.jdkver_latest }}
- name: Run
run: |
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jdk"
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jdk" JAVA_TO_TEST="${JAVA_HOME}/bin/java" JAVA_COMMAND="${JAVA_HOME}/bin/java"
./testHeadlessComponents.sh
- name: Pack results
if: ${{ always() }}
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
java-version: ${{ matrix.jdkver || env.jdkver_latest }}
- name: Run
run: |
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre"
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre" JAVA_TO_TEST="${JAVA_HOME}/bin/java" JAVA_COMMAND="${JAVA_HOME}/bin/java"
./testHeadlessComponents.sh
- name: Pack results
if: ${{ always() }}
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Run
shell: msys2 {0}
run: |
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre"
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre" JAVA_TO_TEST="${JAVA_HOME}/bin/java" JAVA_COMMAND="${JAVA_HOME}/bin/java"
./testHeadlessComponents.sh
- name: Pack results
if: ${{ always() }}
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
- name: Run
shell: msys2 {0}
run: |
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre"
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre" JAVA_TO_TEST="${JAVA_HOME}/bin/java" JAVA_COMMAND="${JAVA_HOME}/bin/java"
./testHeadlessComponents.sh
- name: Pack results
if: ${{ always() }}
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
run: echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.zprofile && exec -l $SHELL

- name: Verify Bash Version
run: /usr/local/bin/bash --version
run: /opt/homebrew/Cellar/bash/5.2.37/bin/bash --version

- name: Set up JDK
uses: actions/setup-java@v3
Expand All @@ -230,8 +230,8 @@ jobs:
java-version: ${{ matrix.jdkver || env.jdkver_latest }}
- name: Run
run: |
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre" WORKSPACE=/Users/runner/workspace
/usr/local/bin/bash testHeadlessComponents.sh
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jre" WORKSPACE=/Users/runner/workspace JAVA_TO_TEST="${JAVA_HOME}/bin/java" JAVA_COMMAND="${JAVA_HOME}/bin/java"
/opt/homebrew/Cellar/bash/5.2.37/bin/bash testHeadlessComponents.sh
- name: Pack results
if: ${{ always() }}
run: |
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
run: echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.zprofile && exec -l $SHELL

- name: Verify Bash Version
run: /usr/local/bin/bash --version
run: /opt/homebrew/Cellar/bash/5.2.37/bin/bash --version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what?!!?!? why!?!?!!?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently the path to the bash executable changed since the last GH actions run..


- name: Set up JDK
uses: actions/setup-java@v3
Expand All @@ -288,8 +288,8 @@ jobs:
java-version: ${{ matrix.jdkver || env.jdkver_latest }}
- name: Run
run: |
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} BOOTJDK_DIR=~/bootjdk JREJDK="jdk" WORKSPACE=/Users/runner/workspace
/usr/local/bin/bash testHeadlessComponents.sh
export OJDK_VERSION_NUMBER=${{ matrix.jdkver || env.jdkver_latest }} JREJDK="jdk" WORKSPACE=/Users/runner/workspace JAVA_TO_TEST="${JAVA_HOME}/bin/java" JAVA_COMMAND="${JAVA_HOME}/bin/java"
/opt/homebrew/Cellar/bash/5.2.37/bin/bash testHeadlessComponents.sh
- name: Pack results
if: ${{ always() }}
run: |
Expand Down
49 changes: 6 additions & 43 deletions testHeadlessComponents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,45 +42,6 @@ else
exit 1
fi

function unwrap_file_to_location() {
if [ "$OS" == "mac" -o "$OS" == "linux" ]; then
tar --strip-components=1 -xf $1 -C $2
elif [ "$OS" == "windows" ]; then
unzip $1 -d $2
# Get the name of the extracted folder (assuming only one folder is present)
ls $2
extracted_folder_name=$(ls $2)

# Ensure only one folder is found
if [ "$(ls $2 | wc -l)" -eq 1 ]; then
# Move the contents to the desired destination without creating a new directory
mv "$2/$extracted_folder_name"/* "$2"
else
echo "Error: More than one directory found in $2."
fi
fi
}

function installAlternativeJDK() {
ARCH=$( uname -m )
if [ "x$BOOTJDK_DIR" == "x" ]; then
BOOTJDK_DIR=~/bootjdk
fi
if [ "x$BOOTJDK_ARCHIVE_DIR" == "x" ]; then
BOOTJDK_ARCHIVE_DIR=$WORKSPACE/bootjdkarchive
mkdir -p $BOOTJDK_ARCHIVE_DIR
cd $BOOTJDK_ARCHIVE_DIR
curl -OLJks "https://api.adoptopenjdk.net/v3/binary/latest/$OJDK_VERSION_NUMBER/ga/$OS/$ARCH/jdk/hotspot/normal/adoptopenjdk"
rm -rf ${BOOTJDK_DIR}
mkdir -p ${BOOTJDK_DIR}
unwrap_file_to_location ${BOOTJDK_ARCHIVE_DIR}/* ${BOOTJDK_DIR}
else
rm -rf ${BOOTJDK_DIR}
mkdir -p ${BOOTJDK_DIR}
ls ${BOOTJDK_ARCHIVE_DIR}
unwrap_file_to_location ${BOOTJDK_ARCHIVE_DIR}/*${ARCH}.tarxz ${BOOTJDK_DIR}
fi
}

function run_java_with_headless {
COMPONENTS_TO_TEST=$2
Expand Down Expand Up @@ -172,14 +133,16 @@ popd

LOGFILE=$TMPRESULTS/testHeadlessComponent.log

installAlternativeJDK
#JAVA_COMMAND always contains link to the java from the SDK

JAVAC_BINARY="${BOOTJDK_DIR}/bin/javac"
if [ "$OS" == "mac" ]; then
JAVAC_BINARY="${JAVA_COMMAND}c"
if [ "$OS" == "mac1" ]; then
JAVAC_BINARY="${BOOTJDK_DIR}/Contents/Home/bin/javac"
fi

#use bootjdk javac
#JAVA_TO_TEST can contain either link to SDK or JRE java, however always the java that we want to test with
JAVA=$JAVA_TO_TEST

#other classes depend on this one, so we might as well just compile the main class
cp -r $SCRIPT_DIR/testHeadlessComponents $WORKSPACE
ls $WORKSPACE
Expand Down
Loading