forked from dragonwell-project/dragonwell11
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d5b44a
commit 8dbd0d4
Showing
8 changed files
with
524 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# | ||
## Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. | ||
## DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
## | ||
## This code is free software; you can redistribute it and/or modify it | ||
## under the terms of the GNU General Public License version 2 only, as | ||
## published by the Free Software Foundation. Alibaba designates this | ||
## particular file as subject to the "Classpath" exception as provided | ||
## by Oracle in the LICENSE file that accompanied this code. | ||
## | ||
## This code is distributed in the hope that it will be useful, but WITHOUT | ||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
## version 2 for more details (a copy is included in the LICENSE file that | ||
## accompanied this code). | ||
## | ||
## You should have received a copy of the GNU General Public License version | ||
## 2 along with this work; if not, write to the Free Software Foundation, | ||
## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
## | ||
|
||
name: 'Build serverless-adapter' | ||
description: 'Build it using built JDK' | ||
inputs: | ||
platform: | ||
description: 'Platform name' | ||
required: true | ||
debug-suffix: | ||
description: 'File name suffix denoting debug level, possibly empty' | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Found bundle' | ||
id: bundle_found | ||
run: | | ||
# Only support linux now. | ||
jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)" | ||
if [[ "$jdk_bundle_tar_gz" != "" ]]; then | ||
jdk_bundle_name=${jdk_bundle_tar_gz##*/} | ||
echo "jdk_pkg=$jdk_bundle_tar_gz" >> $GITHUB_OUTPUT | ||
echo "jdk_pkg_name=$jdk_bundle_name" >> $GITHUB_OUTPUT | ||
echo "decompress_cmd=tar zxf" >> $GITHUB_OUTPUT | ||
echo "decompress_redirect_flag=-C" >> $GITHUB_OUTPUT | ||
echo "decompress_extra_cmd=--strip-components=1" >> $GITHUB_OUTPUT | ||
echo "compress_cmd=tar zcf" >> $GITHUB_OUTPUT | ||
else | ||
echo "jdk_pkg=" >> $GITHUB_OUTPUT | ||
echo "jdk_pkg_name=" >> $GITHUB_OUTPUT | ||
echo "decompress_cmd=" >> $GITHUB_OUTPUT | ||
echo "decompress_redirect_flag=" >> $GITHUB_OUTPUT | ||
echo "decompress_extra_cmd=" >> $GITHUB_OUTPUT | ||
echo "compress_cmd=" >> $GITHUB_OUTPUT | ||
fi | ||
shell: bash | ||
|
||
- name: 'Bundle decompression' | ||
id: bundle_decompress | ||
run: | | ||
mkdir -p bundle_workdir | ||
${{ steps.bundle_found.outputs.decompress_cmd }} ${{ steps.bundle_found.outputs.jdk_pkg }} ${{ steps.bundle_found.outputs.decompress_redirect_flag }} bundle_workdir ${{ steps.bundle_found.outputs.decompress_extra_cmd }} | ||
bin_path=$(find bundle_workdir -name bin) | ||
pwd=$(pwd) | ||
java_home_path=${bin_path%%'/bin'*} | ||
echo "java_home=$pwd/$java_home_path" >> $GITHUB_OUTPUT | ||
shell: bash | ||
if: steps.bundle_found.outputs.jdk_pkg != '' && steps.bundle_found.outputs.decompress_cmd != '' | ||
|
||
- name: 'Checkout serverless-adapter source code' | ||
id: serverless_adapter_checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: dragonwell-project/serverless-adapter | ||
ref: main | ||
path: serverless-adapter | ||
|
||
- name: 'Build serverless-adapter' | ||
id: serverless_adapter_build | ||
run: | | ||
JAVA_HOME=${{ steps.bundle_decompress.outputs.java_home }};PATH=${{ steps.bundle_decompress.outputs.java_home }}/bin:$PATH mvn package | ||
shell: bash | ||
working-directory: serverless-adapter | ||
|
||
- name: 'Copy serverless-adapter into boot jdk' | ||
run: | | ||
mkdir -p ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless | ||
cp -f serverless-adapter/target/serverless-adapter-0.1.jar ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/serverless-adapter.jar | ||
cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/libloadclassagent.so | ||
shell: bash | ||
|
||
- name: 'Regenerate bundle' | ||
run: | | ||
cd ${{ steps.bundle_decompress.outputs.java_home }} | ||
${{ steps.bundle_found.outputs.compress_cmd }} ${{ steps.bundle_found.outputs.jdk_pkg_name }} * | ||
cd - | ||
mv -f ${{ steps.bundle_decompress.outputs.java_home }}/${{ steps.bundle_found.outputs.jdk_pkg_name }} ${{ steps.bundle_found.outputs.jdk_pkg }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,91 +19,131 @@ | |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
# | ||
|
||
name: Dragonwell_11_build_test | ||
name: Prerequisites | ||
|
||
on: [pull_request] | ||
on: | ||
workflow_call: | ||
inputs: | ||
platforms: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
check_commit: | ||
name: 'Check Commit Message' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dragonwell-releng/check_commit_action@master | ||
if: github.event_name == 'pull_request' | ||
|
||
build_release_amd64_jdk: | ||
prerequisites: | ||
name: 'Prerequisites' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest | ||
outputs: | ||
should_run: ${{ steps.check_submit.outputs.should_run }} | ||
bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }} | ||
jdk_version: ${{ steps.check_jdk_versions.outputs.jdk_version }} | ||
platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }} | ||
platform_linux_aarch64: ${{ steps.check_platforms.outputs.platform_linux_aarch64 }} | ||
platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }} | ||
dependencies: ${{ steps.check_deps.outputs.dependencies }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile release mode on amd64 | ||
run: | | ||
chmod 755 configure | ||
bash make.sh release | ||
- name: 'Check if submit tests should actually run depending on secrets and manual triggering' | ||
id: check_submit | ||
run: echo "::set-output name=should_run::${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}" | ||
|
||
- name: Sanity test | ||
- name: 'Check which platforms should be included' | ||
id: check_platforms | ||
run: | | ||
TEST_JDK_HOME=build/linux-x86_64-normal-server-release/images/jdk | ||
${TEST_JDK_HOME}/bin/java -version | ||
echo "::set-output name=platform_linux_x64::${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '') }}" | ||
echo "::set-output name=platform_linux_aarch64::${{ contains(github.event.inputs.platforms, 'linux aarch64') || (github.event.inputs.platforms == '') }}" | ||
echo "::set-output name=platform_windows_x64::${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '') }}" | ||
if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
build_release_arm64_jdk: | ||
runs-on: [self-hosted , ARM64] | ||
container: | ||
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile release mode on arm64 | ||
run: | | ||
chmod 755 configure | ||
bash make.sh release | ||
- name: 'Determine unique bundle identifier' | ||
id: check_bundle_id | ||
run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}" | ||
if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
- name: Sanity test | ||
run: | | ||
TEST_JDK_HOME=build/linux-aarch64-normal-server-release/images/jdk | ||
${TEST_JDK_HOME}/bin/java -version | ||
- name: 'Checkout the source' | ||
uses: actions/checkout@v3 | ||
with: | ||
path: jdk | ||
if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
build_fastdebug_amd64_jdk: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile slowdebug mode | ||
run: | | ||
chmod 755 configure | ||
bash make.sh fastdebug | ||
- name: 'Determine versions and locations to be used for dependencies' | ||
id: check_deps | ||
run: "echo ::set-output name=dependencies::`cat make/autoconf/version-numbers make/conf/test-dependencies | sed -e '1i {' -e 's/#.*//g' -e 's/\"//g' -e 's/\\(.*\\)=\\(.*\\)/\"\\1\": \"\\2\",/g' -e '$s/,\\s\\{0,\\}$/\\}/'`" | ||
working-directory: jdk | ||
if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
- name: Sanity test | ||
run: | | ||
TEST_JDK_HOME=build/linux-x86_64-normal-server-fastdebug/images/jdk | ||
${TEST_JDK_HOME}/bin/java -version | ||
- name: 'Print extracted dependencies to the log' | ||
run: "echo '${{ steps.check_deps.outputs.dependencies }}'" | ||
if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
build_slowdebug_amd64_jdk: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile slowdebug mode | ||
- name: 'Determine full JDK versions' | ||
id: check_jdk_versions | ||
shell: bash | ||
run: | | ||
chmod 755 configure | ||
bash make.sh debug | ||
FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }} | ||
INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }} | ||
UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }} | ||
PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }} | ||
if [ "x${PATCH}" != "x0" ]; then | ||
V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH} | ||
elif [ "x${UPDATE}" != "x0" ]; then | ||
V=${FEATURE}.${INTERIM}.${UPDATE} | ||
elif [ "x${INTERIM}" != "x0" ]; then | ||
V={FEATURE}.${INTERIM} | ||
else | ||
V=${FEATURE} | ||
fi | ||
echo "::set-output name=jdk_version::${V}" | ||
if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
- name: Sanity test | ||
run: | | ||
TEST_JDK_HOME=build/linux-x86_64-normal-server-slowdebug/images/jdk | ||
${TEST_JDK_HOME}/bin/java -version | ||
#- name: 'Determine the jtreg ref to checkout' | ||
# run: "echo JTREG_REF=jtreg-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }} >> $GITHUB_ENV" | ||
# if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
build_release_riscv_jdk: | ||
runs-on: [self-hosted , X64] | ||
container: | ||
image: docker.io/alibabadragonwelljdk/centos7_gcc7_build_image:latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile release mode riscv jdk | ||
run: | | ||
chmod 755 configure | ||
LD_LIBRARY_PATH=/opt/riscv_toolchain_linux/lib64 \ | ||
PATH=/opt/riscv_toolchain_linux/bin:/usr/local/gcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ | ||
bash configure --verbose --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:[email protected]' --with-vendor-vm-bug-url='mailto:[email protected]' --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:[email protected]' --with-vendor-vm-bug-url='mailto:[email protected]' --without-version-opt --without-version-pre --with-version-build=9 --with-version-patch=14 --with-boot-jdk=/usr/lib/jvm/jdk-10 --with-debug-level=release --with-native-debug-symbols=external --with-jvm-variants=server --disable-warnings-as-errors --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root -with-boot-jdk=/usr/lib/jvm/jdk-10 --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root | ||
make images | ||
#- name: 'Determine the jtreg version to build' | ||
# run: echo "BUILD_VERSION=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}" >> $GITHUB_ENV | ||
# if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
#- name: 'Determine the jtreg build number to build' | ||
# run: echo "BUILD_NUMBER=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }}" >> $GITHUB_ENV | ||
# if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
#- name: 'Check if a jtreg image is present in the cache' | ||
# id: jtreg | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: ~/jtreg/ | ||
# key: jtreg-${{ env.JTREG_REF }}-v1 | ||
# if: steps.check_submit.outputs.should_run != 'false' | ||
|
||
#- name: 'Checkout the jtreg source' | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# repository: "openjdk/jtreg" | ||
# ref: ${{ env.JTREG_REF }} | ||
# path: jtreg | ||
# if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' | ||
|
||
#- name: 'Build jtreg' | ||
# run: bash make/build.sh --jdk ${JAVA_HOME_8_X64} | ||
# working-directory: jtreg | ||
# if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' | ||
|
||
#- name: 'Move jtreg image to destination folder' | ||
# run: mv build/images/jtreg ~/ | ||
# working-directory: jtreg | ||
# if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' | ||
|
||
#- name: 'Store jtreg for use by later steps' | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }} | ||
# path: ~/jtreg/ | ||
# if: steps.check_submit.outputs.should_run != 'false' |
Oops, something went wrong.