Skip to content

Commit

Permalink
[Misc] update GHA config
Browse files Browse the repository at this point in the history
Summary: as title

Testing: CI pipline

Reviewers: lei.yul, sendaoYan

Issue: #651
  • Loading branch information
Accelerator1996 committed Jul 2, 2024
1 parent cf827ca commit 1a9e964
Show file tree
Hide file tree
Showing 5 changed files with 509 additions and 270 deletions.
57 changes: 57 additions & 0 deletions .github/actions/build-serverless-adapter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# 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'
run: |
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
shell: bash

- name: 'Build serverless-adapter'
id: serverless_adapter_build
run: |
JAVA_HOME=${{fromJSON(inputs.java-home)}};PATH=${{fromJSON(inputs.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 }}/jre/lib/serverless
cp -f serverless-adapter/target/serverless-adapter-0.1.jar ${{ steps.bundle_decompress.outputs.java_home }}/jre/lib/serverless/serverless-adapter.jar
cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/jre/lib/serverless/libloadclassagent.so
shell: bash
107 changes: 107 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#
# 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: '[ "debug", "release" ]'
configure-arguments:
required: false
type: string
runs-on:
required: true
type: string
docker-image:
required: true
type: string
bundle_id:
required: true
type: string

jobs:
build-linux:
name: build
runs-on: ${{fromJson(inputs.runs-on)}}
container:
image: ${{fromJson(inputs.docker-image)}}

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: 'Checkout the JDK source'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Configure'
run: >
bash configure
${{ matrix.flags }}
${{ fromJSON(inputs.configure-arguments) }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
- name: 'Build'
id: build
run: |
make clean
make ${{ fromJson(inputs.make-target) }} CONF=${{ fromJson(inputs.make-conf) }}-${{ matrix.conf-suffix }}
- name: 'Build serverless-adapter'
id: build-serverless-adapter
uses: ./.github/actions/build-serverless-adapter
with:
java-home: '"${PWD}/build/${{fromJson(inputs.make-conf)}}-${{matrix.conf-suffix}}/images/j2sdk-image"'

- name: 'Upload jdk image'
uses: actions/upload-artifact@v2
with:
name: linux-${{ fromJson(inputs.platform) }}-image-${{ fromJson(inputs.bundle_id) }}
path: |
${PWD}/build/${{fromJson(inputs.make-conf)}}-${{matrix.conf-suffix}}/images/j2sdk-image
58 changes: 52 additions & 6 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved.
# 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
Expand All @@ -19,13 +19,59 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#

name: Dragonwell_8_commit_style_check
name: Prerequisites

on: [pull_request]
on:
workflow_call:
inputs:
platforms:
required: true
type: string
outputs:
should_run:
value: ${{ jobs.prerequisites.outputs.should_run }}
bundle_id:
value: ${{ jobs.prerequisites.outputs.bundle_id }}
platform_linux_x64:
value: ${{ jobs.prerequisites.outputs.platform_linux_x64 }}
platform_linux_aarch64:
value: ${{ jobs.prerequisites.outputs.platform_linux_aarch64 }}
platform_windows_x64:
value: ${{ jobs.prerequisites.outputs.platform_windows_x64 }}

jobs:
check_commit:
#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'

prerequisites:
name: 'Prerequisites'
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_submit.outputs.should_run }}
bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }}
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 }}

steps:
- uses: actions/checkout@v2
- uses: dragonwell-releng/check_commit_action@master
- name: 'Check if submit tests should actually run depending on secrets and manual triggering'
id: check_submit
run: echo "::set-output name=should_run::${{ inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}"

- name: 'Check which platforms should be included'
id: check_platforms
run: |
echo "::set-output name=platform_linux_x64::${{ contains(inputs.platforms, 'linux x64') || (inputs.platforms == '') }}"
echo "::set-output name=platform_linux_aarch64::${{ contains(inputs.platforms, 'linux aarch64') || (inputs.platforms == '') }}"
echo "::set-output name=platform_windows_x64::${{ contains(inputs.platforms, 'windows x64') || (inputs.platforms == '') }}"
if: steps.check_submit.outputs.should_run != false

- 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'
Loading

0 comments on commit 1a9e964

Please sign in to comment.