Skip to content

Commit

Permalink
Test mac-os builds both on Intel and Apple M
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed May 28, 2024
1 parent ef9fbc1 commit 46f574e
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions .github/workflows/buildJDK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ jobs:
path: mandrel-java23-linux-amd64.tarxz

build-and-test-on-mac:
name: MacOS Build and test ${{ matrix.mandrel-ref }} branch/tag
runs-on: macos-latest
name: ${{ matrix.os }} Build and test ${{ matrix.mandrel-ref }} branch/tag
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-13]
mandrel-ref: [graal/master]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -172,17 +173,30 @@ jobs:
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.quarkus-name }}-maven-
- name: Get runner architecture
id: arch
run: |
export ARCH=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]' | sed 's/arm64/aarch64/')
echo "ARCH=${ARCH}"
# export ARCH to github output
echo "ARCH=${ARCH}" >> "$GITHUB_OUTPUT"
- name: Get latest OpenJDK 23 with static libs
env:
ARCH: ${{ steps.arch.outputs.ARCH }}
run: |
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/mac/x64/jdk/hotspot/normal/eclipse -o jdk.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/mac/x64/staticlibs/hotspot/normal/eclipse -o jdk-static-libs.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/mac/${ARCH}/jdk/hotspot/normal/eclipse -o jdk.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/mac/${ARCH}/staticlibs/hotspot/normal/eclipse -o jdk-static-libs.tar.gz
mkdir -p ${JAVA_HOME}
tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1
tar xf jdk-static-libs.tar.gz -C ${JAVA_HOME} --strip-components=1
# work-around for https://github.com/adoptium/temurin-build/issues/3602
pushd ${MAC_JAVA_HOME}
if [ -e lib/static/darwin-arm64 ]; then
mv lib/static/darwin-arm64 lib/static/darwin-amd64
if [[ -e lib/static/darwin-arm64 ]]; then
if [[ "$ARCH" == "x64" ]]; then
mv lib/static/darwin-arm64 lib/static/darwin-amd64
else
mv lib/static/darwin-arm64 lib/static/darwin-${ARCH}
fi
fi
popd
echo ${MAC_JAVA_HOME}
Expand All @@ -194,12 +208,15 @@ jobs:
with:
python-version: '3.10'
- name: Build Mandrel JDK
env:
ARCH: ${{ steps.arch.outputs.ARCH }}
run: |
export JAVA_HOME=${MAC_JAVA_HOME}
${MAC_JAVA_HOME}/bin/java -ea build.java --mx-home ${MX_HOME} --mandrel-repo ${MANDREL_REPO} --mandrel-version "${MANDREL_VERSION}" --archive-suffix tar.gz
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export ARCHIVE_NAME="mandrel-java23-darwin-amd64-${MANDREL_VERSION_UNTIL_SPACE}.tar.gz"
mv ${ARCHIVE_NAME} mandrel-java23-darwin-amd64.tar.gz
export ARCH=$( echo ${ARCH} | sed 's/x64/amd64/' )
export ARCHIVE_NAME="mandrel-java23-darwin-${ARCH}-${MANDREL_VERSION_UNTIL_SPACE}.tar.gz"
mv ${ARCHIVE_NAME} mandrel-java23-darwin-${ARCH}.tar.gz
- name: Smoke tests
run: |
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
Expand Down Expand Up @@ -238,9 +255,11 @@ jobs:
diff java.txt native.txt
- name: Upload Mandrel build
uses: actions/upload-artifact@v3
env:
ARCH: ${{ steps.arch.outputs.ARCH }}
with:
name: mandrel-java23-darwin-amd64-test-build
path: mandrel-java23-darwin-amd64.tar.gz
name: mandrel-java23-darwin-${ARCH}-test-build
path: mandrel-java23-darwin-${ARCH}.tar.gz

build-and-test-on-windows:
name: Windows Build and test ${{ matrix.mandrel-ref }} branch/tag
Expand Down

0 comments on commit 46f574e

Please sign in to comment.