Skip to content

Commit

Permalink
Merge pull request #17 from sophia-guo/target
Browse files Browse the repository at this point in the history
Support custom_target
  • Loading branch information
sophia-guo authored May 12, 2020
2 parents 0aaf44c + 43100af commit 79d2b51
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "build-test"
on: # rebuild any PRs and main branch changes
push:
branches:
- feature
branches-ignore:
- '**'

jobs:
build: # make sure build/ci work properly
Expand All @@ -21,6 +21,6 @@ jobs:
uses: ./
with:
version: '11'
jdksource: 'customized'
jdksource: 'install-jdk'
build_list: 'functional'
target: '_floatSanityTests'
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,7 @@ Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
lib/**/*

# Ignore Eclipse project
.project
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ You can also:
| version | 8 |
| build_list | openjdk |
| target | _jdk_math |
| custom_target | |
| jdksource | upstream |


### version
The Java version that tests are running against (Supported values are: 8, 9, 10, 11, 12, 13, ...)
By default, this action will run against upstream jdk build action installed JDK. Specifying this parameter is required when jdksource is not `upstream`.
Expand All @@ -103,6 +105,9 @@ Test category. The values are openjdk, functional, system, perf, external.
### target
Specific testcase name or different test level under build_list

### custom_target
Set customized testcase when any custom target is selected(e.g. jdk_custom, langtools_custom, etc) , path to the test class to execute

### jdksource
THe source of test against JDK. Default is `upstream`. Supported value is [`upstream`, `install-jdk`, `github-hosted`]
- upstream: JDK built by buildjdk action
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ inputs:
default: 'openjdk'
target: # test
description:
default: '_jdk_custom'
default: '_jdk_math'
custom_target: # Used if need to set non-default custom target
description:
required: false
runs:
using: 'node12'
main: 'dist/index.js'
13 changes: 10 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2890,6 +2890,7 @@ function run() {
const version = core.getInput('version', { required: false });
const buildList = core.getInput('build_list', { required: false });
const target = core.getInput('target', { required: false });
const customTarget = core.getInput('custom_target', { required: false });
// let arch = core.getInput("architecture", { required: false })
if (jdksource !== 'upstream' &&
jdksource !== 'github-hosted' &&
Expand All @@ -2906,7 +2907,7 @@ function run() {
if (jdksource !== 'upstream' && version.length === 0) {
core.setFailed('Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.');
}
yield runaqa.runaqaTest(version, jdksource, buildList, target);
yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget);
}
catch (error) {
core.setFailed(error.message);
Expand Down Expand Up @@ -3237,7 +3238,7 @@ const io = __importStar(__webpack_require__(1));
const tc = __importStar(__webpack_require__(533));
const path = __importStar(__webpack_require__(622));
const isWindows = process.platform === 'win32';
function runaqaTest(version, jdksource, buildList, target) {
function runaqaTest(version, jdksource, buildList, target, customTarget) {
return __awaiter(this, void 0, void 0, function* () {
yield installDependency();
process.env.BUILD_LIST = buildList;
Expand All @@ -3260,7 +3261,13 @@ function runaqaTest(version, jdksource, buildList, target) {
process.chdir('TKG');
try {
yield exec.exec('make compile');
yield exec.exec('make', [`${target}`], options);
if (target.includes('custom') && customTarget !== '') {
const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`;
yield exec.exec('make', [`${target}`, `${customOption}`], options);
}
else {
yield exec.exec('make', [`${target}`], options);
}
}
catch (error) {
core.setFailed(error.message);
Expand Down
3 changes: 2 additions & 1 deletion src/aqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ async function run(): Promise<void> {
const version = core.getInput('version', {required: false})
const buildList = core.getInput('build_list', {required: false})
const target = core.getInput('target', {required: false})
const customTarget = core.getInput('custom_target',{required: false})
// let arch = core.getInput("architecture", { required: false })
if (
jdksource !== 'upstream' &&
Expand Down Expand Up @@ -35,7 +36,7 @@ async function run(): Promise<void> {
)
}

await runaqa.runaqaTest(version, jdksource, buildList, target)
await runaqa.runaqaTest(version, jdksource, buildList, target, customTarget)
} catch (error) {
core.setFailed(error.message)
}
Expand Down
10 changes: 8 additions & 2 deletions src/runaqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export async function runaqaTest(
version: string,
jdksource: string,
buildList: string,
target: string
target: string,
customTarget: string
): Promise<void> {
await installDependency()
process.env.BUILD_LIST = buildList
Expand All @@ -36,7 +37,12 @@ export async function runaqaTest(
process.chdir('TKG')
try {
await exec.exec('make compile')
await exec.exec('make', [`${target}`], options)
if (target.includes('custom') && customTarget !== '') {
const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`
await exec.exec('make', [`${target}`, `${customOption}`], options)
} else {
await exec.exec('make', [`${target}`], options)
}
} catch (error) {
core.setFailed(error.message)
}
Expand Down

0 comments on commit 79d2b51

Please sign in to comment.