-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: as title Testing: CI pipline Reviewers: lei.yul, sendaoYan Issue: #651
- Loading branch information
1 parent
cf827ca
commit 6f2ee24
Showing
7 changed files
with
751 additions
and
270 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,62 @@ | ||
# | ||
# Copyright (c) 2024 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: | ||
java-home: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Checkout serverless-adapter source code' | ||
id: serverless_adapter_checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: dragonwell-project/serverless-adapter-jdk8 | ||
ref: main | ||
path: serverless-adapter | ||
|
||
- name: 'Install dependencies' | ||
id: install_dep | ||
run: | | ||
mkdir -p maven | ||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz | ||
tar -xvf apache-maven-3.8.8-bin.tar.gz -C maven --strip-components=1 | ||
echo "maven_home=${GITHUB_WORKSPACE}/maven/bin" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: 'Build serverless-adapter' | ||
id: serverless_adapter_build | ||
run: | | ||
export JAVA_HOME=${{ inputs.java-home }} | ||
export PATH=${{ inputs.java-home }}/bin:${{ steps.install_dep.outputs.maven_home }}:$PATH | ||
mvn package | ||
shell: bash | ||
working-directory: serverless-adapter | ||
|
||
- name: 'Copy serverless-adapter into boot jdk' | ||
run: | | ||
mkdir -p ${{ inputs.java-home }}/jre/lib/serverless | ||
cp -f serverless-adapter/target/serverless-adapter-0.1.jar ${{ inputs.java-home }}/jre/lib/serverless/serverless-adapter.jar | ||
cp -f serverless-adapter/output/libloadclassagent.so ${{ inputs.java-home }}/jre/lib/serverless/libloadclassagent.so | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# | ||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. 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. Oracle 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. | ||
# | ||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
# or visit www.oracle.com if you need additional information or have any | ||
# questions. | ||
# | ||
|
||
inputs: | ||
platform: | ||
description: 'Platform name' | ||
required: true | ||
outputs: | ||
boot_jdk: | ||
value: ${{ steps.get_jdk.outputs.boot_jdk }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Determine jdk url' | ||
id: get_jdk_url | ||
run: | | ||
if [ "${{ inputs.platform }}" = "x86_64" ] ; then | ||
echo "jdk_url= https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_x64_linux.tar.gz" >> $GITHUB_OUTPUT | ||
elif [ "${{ inputs.platform }}" = "aarch64" ] ; then | ||
echo "jdk_url= https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_aarch64_linux.tar.gz" >> $GITHUB_OUTPUT | ||
fi | ||
shell: bash | ||
|
||
- name: 'Get jdk' | ||
id: get_jdk | ||
run: | | ||
wget ${{ steps.get_jdk_url.outputs.jdk_url }} -O jdk.tar.gz | ||
mkdir -p bootJdk | ||
tar zxvf jdk.tar.gz -C bootJdk --strip-components=1 | ||
echo "boot_jdk=${PWD}/bootJdk" >> $GITHUB_OUTPUT | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# | ||
# Copyright (c) 2024 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 (linux)' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
platform: | ||
required: true | ||
type: string | ||
make-target: | ||
required: false | ||
type: string | ||
default: '"images"' | ||
make-conf: | ||
required: false | ||
type: string | ||
debug-levels: | ||
required: false | ||
type: string | ||
default: '[ "release" ]' | ||
#default: '[ "debug", "release" ]' | ||
apt-extra-packages: | ||
required: false | ||
type: string | ||
configure-arguments: | ||
required: false | ||
type: string | ||
runs-on: | ||
required: true | ||
type: string | ||
bundle_id: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-linux: | ||
name: build | ||
runs-on: ${{ fromJSON(inputs.runs-on) }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
debug-level: ${{ fromJSON(inputs.debug-levels) }} | ||
include: | ||
- debug-level: release | ||
flags: --with-debug-level=release | ||
conf-suffix: release | ||
#- debug-level: debug | ||
# flags: --with-debug-level=fastdebug | ||
# suffix: -debug | ||
# conf-suffix: fastdebug | ||
|
||
steps: | ||
- name: 'Install dependencies' | ||
run: | | ||
sudo apt update -y | ||
sudo apt install -y ${{ inputs.apt-extra-packages }} | ||
if: ${{ inputs.apt-extra-packages }} != '' | ||
|
||
- name: 'Checkout the JDK source' | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: 'Get boot jdk' | ||
id: get_boot_jdk | ||
uses: ./.github/actions/get-bootjdk | ||
with: | ||
platform: ${{ inputs.platform }} | ||
|
||
- name: 'Configure' | ||
run: > | ||
bash configure | ||
--with-boot-jdk=${{ steps.get_boot_jdk.outputs.boot_jdk }} | ||
${{ matrix.flags }} | ||
${{ inputs.configure-arguments }} || ( | ||
echo "Dumping config.log:" && | ||
cat config.log && | ||
exit 1) | ||
- name: 'Build' | ||
id: build | ||
run: | | ||
make clean | ||
make ${{ inputs.make-target }} CONF=${{ inputs.make-conf }}-${{ matrix.conf-suffix }} | ||
- name: 'Build serverless-adapter' | ||
id: build-serverless-adapter | ||
uses: ./.github/actions/build-serverless-adapter | ||
with: | ||
java-home: ${GITHUB_WORKSPACE}/build/${{ inputs.make-conf }}-${{matrix.conf-suffix}}/images/j2sdk-image | ||
if: ${{ matrix.debug-level }} == 'release' | ||
|
||
- name: 'Create bundle file' | ||
id: get_bundle_file | ||
run: | | ||
filename=linux-${{ inputs.platform }}-${{ matrix.debug-level }}-image-${{ inputs.bundle_id }}.tar.gz | ||
tar zcvf ${filename} -C ${GITHUB_WORKSPACE}/build/${{ inputs.make-conf }}-${{ matrix.conf-suffix }}/images/ j2sdk-image | ||
echo "bundle_file=${filename}" >> $GITHUB_OUTPUT | ||
echo "bundle_path=${GITHUB_WORKSPACE}/${filename}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: 'Upload jdk image' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.get_bundle_file.outputs.bundle_file }} | ||
path: ${{ steps.get_bundle_file.outputs.bundle_path }} |
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
Oops, something went wrong.