Skip to content

Commit e161081

Browse files
committed
CI: Add CVM github actions
1 parent a45d189 commit e161081

File tree

5 files changed

+135
-278
lines changed

5 files changed

+135
-278
lines changed

.github/actions/do-build/action.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This project is a modified version of OpenJDK, licensed under GPL v2.
2+
# Modifications Copyright (C) 2025 ByteDance Inc.
13
#
24
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
35
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,40 +43,6 @@ runs:
4143
steps:
4244
- name: 'Build'
4345
id: build
44-
run: >
45-
make LOG=info ${{ inputs.make-target }}
46-
|| bash ./.github/scripts/gen-build-failure-report.sh "$GITHUB_STEP_SUMMARY"
47-
shell: bash
48-
49-
- name: 'Check for failure'
50-
id: check
5146
run: |
52-
# Check for failure marker file
53-
build_dir="$(ls -d build/*)"
54-
if [[ -e $build_dir/build-failure ]]; then
55-
# Collect relevant log files
56-
mkdir failure-logs
57-
cp \
58-
$build_dir/spec.gmk \
59-
$build_dir/build.log \
60-
$build_dir/configure.log \
61-
$build_dir/make-support/failure-summary.log \
62-
$build_dir/make-support/failure-logs/* \
63-
failure-logs/ 2> /dev/null || true
64-
echo 'failure=true' >> $GITHUB_OUTPUT
65-
fi
47+
make -f cvm.mk ${{ inputs.make-target }} MODE=${{ matrix.debug-level}}
6648
shell: bash
67-
68-
- name: 'Upload build logs'
69-
uses: actions/upload-artifact@v3
70-
with:
71-
name: failure-logs-${{ inputs.platform }}${{ inputs.debug-suffix }}
72-
path: failure-logs
73-
if: steps.check.outputs.failure == 'true'
74-
75-
# This is the best way I found to abort the job with an error message
76-
- name: 'Notify about build failures'
77-
uses: actions/github-script@v6
78-
with:
79-
script: core.setFailed('Build failed. See summary for details.')
80-
if: steps.check.outputs.failure == 'true'
Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This project is a modified version of OpenJDK, licensed under GPL v2.
2+
# Modifications Copyright (C) 2025 ByteDance Inc.
13
#
24
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
35
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,42 +38,12 @@ inputs:
3638
runs:
3739
using: composite
3840
steps:
39-
40-
- name: 'Determine bundle names'
41-
id: bundles
42-
run: |
43-
# Rename bundles to consistent names
44-
jdk_bundle_zip="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.zip 2> /dev/null || true)"
45-
jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
46-
symbols_bundle="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}-symbols.tar.gz 2> /dev/null || true)"
47-
tests_bundle="$(ls build/*/bundles/jdk-*_bin-tests${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
48-
49-
mkdir bundles
50-
51-
if [[ "$jdk_bundle_zip" != "" ]]; then
52-
mv "$jdk_bundle_zip" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip"
53-
fi
54-
if [[ "$jdk_bundle_tar_gz" != "" ]]; then
55-
mv "$jdk_bundle_tar_gz" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
56-
fi
57-
if [[ "$symbols_bundle" != "" ]]; then
58-
mv "$symbols_bundle" "bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
59-
fi
60-
if [[ "$tests_bundle" != "" ]]; then
61-
mv "$tests_bundle" "bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
62-
fi
63-
64-
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle" != "" ]]; then
65-
echo 'bundles-found=true' >> $GITHUB_OUTPUT
66-
else
67-
echo 'bundles-found=false' >> $GITHUB_OUTPUT
68-
fi
69-
shell: bash
70-
7141
- name: 'Upload bundles artifact'
42+
id: upload-bundles
7243
uses: actions/upload-artifact@v3
7344
with:
74-
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
75-
path: bundles
45+
name: cvm8+17-${{ inputs.platform }}${{ inputs.debug-suffix }}
46+
path: cvm/build/jdk8
7647
retention-days: 1
77-
if: steps.bundles.outputs.bundles-found == 'true'
48+
if-no-files-found: error
49+
overwrite: true

.github/workflows/build-linux.yml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This project is a modified version of OpenJDK, licensed under GPL v2.
2+
# Modifications Copyright (C) 2025 ByteDance Inc.
13
#
24
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
35
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,11 +39,11 @@ on:
3739
make-target:
3840
required: false
3941
type: string
40-
default: 'product-bundles test-bundles'
42+
default: 'cvm8default17'
4143
debug-levels:
4244
required: false
4345
type: string
44-
default: '[ "debug", "release" ]'
46+
default: '[ "fastdebug", "release" ]'
4547
apt-gcc-version:
4648
required: true
4749
type: string
@@ -55,27 +57,17 @@ on:
5557
jobs:
5658
build-linux:
5759
name: build
58-
runs-on: ubuntu-20.04
60+
runs-on: ubuntu-22.04
5961

6062
strategy:
6163
fail-fast: false
6264
matrix:
6365
debug-level: ${{ fromJSON(inputs.debug-levels) }}
64-
include:
65-
- debug-level: debug
66-
flags: --with-debug-level=fastdebug
67-
suffix: -debug
6866

6967
steps:
7068
- name: 'Checkout the JDK source'
7169
uses: actions/checkout@v3
7270

73-
- name: 'Get the BootJDK'
74-
id: bootjdk
75-
uses: ./.github/actions/get-bootjdk
76-
with:
77-
platform: linux-x64
78-
7971
- name: 'Get JTReg'
8072
id: jtreg
8173
uses: ./.github/actions/get-jtreg
@@ -102,31 +94,21 @@ jobs:
10294
sudo apt-get update
10395
sudo apt-get install --only-upgrade apt
10496
sudo apt-get install gcc-${{ inputs.apt-gcc-version }} g++-${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
105-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
106-
107-
- name: 'Configure'
108-
run: >
109-
bash configure
110-
--with-conf-name=${{ inputs.platform }}
111-
${{ matrix.flags }}
112-
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
113-
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
114-
--with-jtreg=${{ steps.jtreg.outputs.path }}
115-
--with-gtest=${{ steps.gtest.outputs.path }}
116-
--enable-jtreg-failure-handler
117-
--with-zlib=system
118-
${{ inputs.extra-conf-options }}
97+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.apt-gcc-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.apt-gcc-version }}
11998
12099
- name: 'Build'
121100
id: build
122101
uses: ./.github/actions/do-build
123102
with:
124103
make-target: '${{ inputs.make-target }}'
125104
platform: ${{ inputs.platform }}
126-
debug-suffix: '${{ matrix.suffix }}'
105+
debug-suffix: '${{ matrix.debug-level}}'
127106

128107
- name: 'Upload bundles'
129-
uses: ./.github/actions/upload-bundles
108+
uses: actions/upload-artifact@v4
130109
with:
131-
platform: ${{ inputs.platform }}
132-
debug-suffix: '${{ matrix.suffix }}'
110+
name: cvm8+17-${{ inputs.platform }}${{ matrix.debug-level }}
111+
path: cvm/build/jdk8
112+
retention-days: 1
113+
if-no-files-found: error
114+
overwrite: true

0 commit comments

Comments
 (0)