Skip to content

Commit

Permalink
Merge pull request #87 from renfeiw/master
Browse files Browse the repository at this point in the history
Add option to pass in openJ9 repo and branch
  • Loading branch information
Shelley Lambert authored Jun 9, 2021
2 parents b7244bb + 757e6cc commit fd84730
Show file tree
Hide file tree
Showing 7 changed files with 7,618 additions and 4,430 deletions.
4 changes: 2 additions & 2 deletions __tests__/runaqa.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//import {runaqaTest} from '../src/runaqa'
describe('TODO - Add a test suite', () => {
it('TODO - Add a test', async () => {});
});
it('TODO - Add a test', async () => {})
})
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: 'openjdk Repo'
required: false
default: 'openjdk-tests:master'
openj9_repo:
description: 'openj9 Repo'
required: false
default: 'openj9:master'
tkg_Repo:
description: 'TKG Repo'
required: false
Expand Down
29 changes: 17 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2954,6 +2954,7 @@ function run() {
const target = core.getInput('target', { required: false });
const customTarget = core.getInput('custom_target', { required: false });
const openjdktestRepo = core.getInput('openjdk_testRepo', { required: false });
const openj9Repo = core.getInput('openj9_repo', { required: false });
const tkgRepo = core.getInput('tkg_Repo', { required: false });
// let arch = core.getInput("architecture", { required: false })
if (jdksource !== 'upstream' &&
Expand All @@ -2971,7 +2972,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, customTarget, openjdktestRepo, tkgRepo);
yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, openj9Repo, tkgRepo);
}
catch (error) {
core.setFailed(error.message);
Expand Down Expand Up @@ -3351,7 +3352,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable prefer-template */
const exec = __importStar(__webpack_require__(986));
const core = __importStar(__webpack_require__(470));
const io = __importStar(__webpack_require__(1));
Expand All @@ -3374,15 +3374,15 @@ if (!tempDirectory) {
}
tempDirectory = path.join(baseLocation, 'actions', 'temp');
}
function runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, tkgRepo) {
function runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, openj9Repo, tkgRepo) {
return __awaiter(this, void 0, void 0, function* () {
yield installDependencyAndSetup();
setSpec();
process.env.BUILD_LIST = buildList;
if (!('TEST_JDK_HOME' in process.env))
process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource);
yield getOpenjdkTestRepo(openjdktestRepo);
yield runGetSh(tkgRepo);
yield runGetSh(tkgRepo, openj9Repo);
//Get Dependencies, using /*zip*/dependents.zip to avoid loop every available files
let dependents = yield tc.downloadTool('https://ci.adoptopenjdk.net/view/all/job/test.getDependency/lastSuccessfulBuild/artifact//*zip*/dependents.zip');
// Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly
Expand All @@ -3406,7 +3406,9 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, openjdk
try {
yield exec.exec('make compile');
if (target.includes('custom') && customTarget !== '') {
const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`;
const customOption = `${target
.substr(1)
.toUpperCase()}_TARGET=${customTarget}`;
yield exec.exec('make', [`${target}`, `${customOption}`], options);
}
else {
Expand Down Expand Up @@ -3506,19 +3508,22 @@ function getOpenjdkTestRepo(openjdktestRepo) {
process.chdir('openjdk-tests');
});
}
function runGetSh(tkgRepo) {
function runGetSh(tkgRepo, openj9Repo) {
return __awaiter(this, void 0, void 0, function* () {
let tkgParameters = '';
let repoBranch = ['AdoptOpenJDK/TKG', 'master'];
let parameters = '';
if (tkgRepo !== 'TKG:master') {
repoBranch = parseRepoBranch(tkgRepo);
tkgParameters = `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git`;
const repoBranch = parseRepoBranch(tkgRepo);
parameters += `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git`;
}
if (openj9Repo !== 'openj9:master') {
const repoBranch = parseRepoBranch(openj9Repo);
parameters += ` --openj9_branch ${repoBranch[1]} --openj9_repo https://github.com/${repoBranch[0]}.git`;
}
if (IS_WINDOWS) {
yield exec.exec(`bash ./get.sh ${tkgParameters}`);
yield exec.exec(`bash ./get.sh ${parameters}`);
}
else {
yield exec.exec(`./get.sh ${tkgParameters}`);
yield exec.exec(`./get.sh ${parameters}`);
}
});
}
Expand Down
Loading

0 comments on commit fd84730

Please sign in to comment.