From 0d039c6b6172170081005c6d413c1238c7efe0e5 Mon Sep 17 00:00:00 2001 From: Nandini-4120 <78912133+Nandini-4120@users.noreply.github.com> Date: Mon, 11 Oct 2021 02:05:06 +0530 Subject: [PATCH 1/5] Fixes #94 --- action.yml | 6 +- dist/index.js | 18 +- src/aqa.ts | 152 ++++++++-------- src/runaqa.ts | 488 ++++++++++++++++++++++++++------------------------ 4 files changed, 348 insertions(+), 316 deletions(-) diff --git a/action.yml b/action.yml index 0ae5ead..3e5bd1f 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,10 @@ inputs: openj9_repo: description: 'openj9 Repo' required: false + openj9-systemtestsRepo: + description: 'Personal openj9-systemtests Repo' + required: false + default: 'openj9-systemtests:master' tkg_Repo: description: 'Personal TKG Repo. For example, octocat/TKG:test' required: false @@ -44,4 +48,4 @@ inputs: required: false runs: using: 'node12' - main: 'dist/index.js' + main: 'dist/index.js' \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 1c92eba..8d1fec0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2956,6 +2956,7 @@ function run() { const aqatestsRepo = core.getInput('aqa-testsRepo', { required: false }); const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}); const openj9Repo = core.getInput('openj9_repo', { required: false }); + const openj9systemtestsRepo = core.getInput('openj9-systemtestsRepo', { required: false }); const tkgRepo = core.getInput('tkg_Repo', { required: false }); const vendorTestRepos = core.getInput('vendor_testRepos', { required: false }); const vendorTestBranches = core.getInput('vendor_testBranches', { @@ -2992,7 +2993,7 @@ function run() { if (vendorTestShas !== '') { vendorTestParams += ` --vendor_shas ${vendorTestShas}`; } - yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo); + yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo,openj9systemtestsRepo); } catch (error) { core.setFailed(error.message); @@ -3394,7 +3395,7 @@ if (!tempDirectory) { } tempDirectory = path.join(baseLocation, 'actions', 'temp'); } -function runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo) { +function runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, openj9systemtestsRepo) { return __awaiter(this, void 0, void 0, function* () { yield installDependencyAndSetup(); setSpec(); @@ -3413,6 +3414,7 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, aqatest // Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly yield exec.exec(`${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`); if (buildList.includes('system')) { + getOpenj9SystemTestsRepo(openj9systemtestsRepo); getAqaSystemTestsRepo(aqasystemtestsRepo); dependents = yield tc.downloadTool('https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip'); // System.dependency has different levels of archive structures archive/systemtest_prereqs/*.* @@ -3572,6 +3574,15 @@ function getAqaSystemTestsRepo(aqasystemtestsRepo) { process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; } +function getOpenj9SystemTestsRepo(openj9systemtestsRepo) { + let repoBranch = ['eclipse-openj9/openj9-systemtest', 'master']; + if (openj9systemtestsRepo.length !== 0) { + repoBranch = parseRepoBranch(openj9systemtestsRepo); + } + process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; + process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; +} + function runGetSh(tkgRepo, openj9Repo, vendorTestParams) { return __awaiter(this, void 0, void 0, function* () { let parameters = ''; @@ -5048,4 +5059,5 @@ exports.exec = exec; /***/ }) -/******/ }); \ No newline at end of file +/******/ }); + diff --git a/src/aqa.ts b/src/aqa.ts index 8c005de..8da3830 100644 --- a/src/aqa.ts +++ b/src/aqa.ts @@ -1,79 +1,83 @@ import * as core from '@actions/core' import * as runaqa from './runaqa' -async function run(): Promise { - try { - const jdksource = core.getInput('jdksource', {required: false}) - 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}) - const aqatestsRepo = core.getInput('aqa-testsRepo', {required: false}) - const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}) - const openj9Repo = core.getInput('openj9_repo', {required: false}) - const tkgRepo = core.getInput('tkg_Repo', {required: false}) - const vendorTestRepos = core.getInput('vendor_testRepos', {required: false}) - const vendorTestBranches = core.getInput('vendor_testBranches', { - required: false - }) - const vendorTestDirs = core.getInput('vendor_testDirs', {required: false}) - const vendorTestShas = core.getInput('vendor_testShas', {required: false}) - - let vendorTestParams = '' - // let arch = core.getInput("architecture", { required: false }) - if ( - jdksource !== 'upstream' && - jdksource !== 'github-hosted' && - jdksource !== 'install-jdk' - ) { - core.error( - `jdksource should be one of [upstream, github-hosted, install-jdk]. Found: ${jdksource}` - ) - } - - if ( - buildList !== 'openjdk' && - !buildList.startsWith('external') && - !buildList.startsWith('functional') && - !buildList.startsWith('perf') && - !buildList.startsWith('system') - ) { - core.setFailed( - `buildList should be one of or sub dir of [openjdk, external, functional, system, perf]. Found: ${buildList}` - ) - } - if (jdksource !== 'upstream' && version.length === 0) { - core.setFailed( - 'Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.' - ) - } - if (vendorTestRepos !== '') { - vendorTestParams = `--vendor_repos ${vendorTestRepos}` - } - if (vendorTestBranches !== '') { - vendorTestParams += ` --vendor_branches ${vendorTestBranches}` - } - if (vendorTestDirs !== '') { - vendorTestParams += ` --vendor_dirs ${vendorTestDirs}` - } - if (vendorTestShas !== '') { - vendorTestParams += ` --vendor_shas ${vendorTestShas}` - } - await runaqa.runaqaTest( - version, - jdksource, - buildList, - target, - customTarget, - aqatestsRepo, - openj9Repo, - tkgRepo, - vendorTestParams, - aqasystemtestsRepo, - ) - } catch (error) { - core.setFailed(error.message) - } + async function run(): Promise { + try { + const jdksource = core.getInput('jdksource', {required: false}) + 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}) + const aqatestsRepo = core.getInput('aqa-testsRepo', {required: false}) + const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}) + const openj9Repo = core.getInput('openj9_repo', {required: false}) + const openj9systemtestsRepo = core.getInput('openj9-systemtestsRepo', { required: false }); + const tkgRepo = core.getInput('tkg_Repo', {required: false}) + const vendorTestRepos = core.getInput('vendor_testRepos', {required: false}) + const vendorTestBranches = core.getInput('vendor_testBranches', { + required: false + }) + const vendorTestDirs = core.getInput('vendor_testDirs', {required: false}) + const vendorTestShas = core.getInput('vendor_testShas', {required: false}) + + let vendorTestParams = '' + // let arch = core.getInput("architecture", { required: false }) + if ( + jdksource !== 'upstream' && + jdksource !== 'github-hosted' && + jdksource !== 'install-jdk' + ) { + core.error( + `jdksource should be one of [upstream, github-hosted, install-jdk]. Found: ${jdksource}` + ) + } + + if ( + buildList !== 'openjdk' && + !buildList.startsWith('external') && + !buildList.startsWith('functional') && + !buildList.startsWith('perf') && + !buildList.startsWith('system') + ) { + core.setFailed( + `buildList should be one of or sub dir of [openjdk, external, functional, system, perf]. Found: ${buildList}` + ) + } + if (jdksource !== 'upstream' && version.length === 0) { + core.setFailed( + 'Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.' + ) + } + if (vendorTestRepos !== '') { + vendorTestParams = `--vendor_repos ${vendorTestRepos}` + } + if (vendorTestBranches !== '') { + vendorTestParams += ` --vendor_branches ${vendorTestBranches}` + } + if (vendorTestDirs !== '') { + vendorTestParams += ` --vendor_dirs ${vendorTestDirs}` + } + if (vendorTestShas !== '') { + vendorTestParams += ` --vendor_shas ${vendorTestShas}` + } + await runaqa.runaqaTest( + version, + jdksource, + buildList, + target, + customTarget, + aqatestsRepo, + openj9Repo, + tkgRepo, + vendorTestParams, + aqasystemtestsRepo, + openj9systemtestsRepo, + ) + } catch (error) { + core.setFailed(error.message) + } } - + run() + + diff --git a/src/runaqa.ts b/src/runaqa.ts index 9e9483e..15f43ed 100644 --- a/src/runaqa.ts +++ b/src/runaqa.ts @@ -5,264 +5,276 @@ import * as tc from '@actions/tool-cache' import * as path from 'path' import * as fs from 'fs' import {ExecOptions} from '@actions/exec/lib/interfaces' - + let tempDirectory = process.env['RUNNER_TEMP'] || '' const IS_WINDOWS = process.platform === 'win32' - + if (!tempDirectory) { - let baseLocation - - if (IS_WINDOWS) { - // On windows use the USERPROFILE env variable - baseLocation = process.env['USERPROFILE'] || 'C:\\' - } else if (process.platform === 'darwin') { - baseLocation = '/Users' - } else { - baseLocation = '/home' - } - tempDirectory = path.join(baseLocation, 'actions', 'temp') + let baseLocation + + if (IS_WINDOWS) { + // On windows use the USERPROFILE env variable + baseLocation = process.env['USERPROFILE'] || 'C:\\' + } else if (process.platform === 'darwin') { + baseLocation = '/Users' + } else { + baseLocation = '/home' + } + tempDirectory = path.join(baseLocation, 'actions', 'temp') } - + export async function runaqaTest( - version: string, - jdksource: string, - buildList: string, - target: string, - customTarget: string, - aqatestsRepo: string, - openj9Repo: string, - tkgRepo: string, - vendorTestParams: string, - aqasystemtestsRepo: string, + version: string, + jdksource: string, + buildList: string, + target: string, + customTarget: string, + aqatestsRepo: string, + openj9Repo: string, + tkgRepo: string, + vendorTestParams: string, + aqasystemtestsRepo: string, + openj9systemtestsRepo: string, ): Promise { - await installDependencyAndSetup() - setSpec() - process.env.BUILD_LIST = buildList - if (!('TEST_JDK_HOME' in process.env)) - process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource) - - await getAqaTestsRepo(aqatestsRepo) - await runGetSh(tkgRepo, openj9Repo, vendorTestParams) - - //Get Dependencies, using /*zip*/dependents.zip to avoid loop every available files - let dependents = await tc.downloadTool( - 'https://ci.adoptopenjdk.net/view/all/job/test.getDependency/lastSuccessfulBuild/artifact//*zip*/dependents.zip' - ) - - let sevenzexe = '7z' - if (fs.existsSync('/usr/bin/yum')) { - sevenzexe = '7za' - } - - // Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly - await exec.exec( - `${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib` - ) - - if (buildList.includes('system')) { - getAqaSystemTestsRepo(aqasystemtestsRepo); - dependents = await tc.downloadTool( - 'https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip' - ) - // System.dependency has different levels of archive structures archive/systemtest_prereqs/*.* - // None of io.mv, io.cp and exec.exec can mv directories as expected (mv archive/ ./). Move subfolder systemtest_prereqs instead. - const dependentPath = await tc.extractZip( - dependents, - `${process.env.GITHUB_WORKSPACE}/` - ) - await io.mv( - `${dependentPath}/archive/systemtest_prereqs`, - `${process.env.GITHUB_WORKSPACE}/aqa-tests` - ) - await io.rmRF(`${dependentPath}/archive`) - } - - const options: ExecOptions = {} - let myOutput = '' - options.listeners = { - stdout: (data: Buffer) => { - myOutput += data.toString() - } - } - process.chdir('TKG') - try { - await exec.exec('make compile') - 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) - } - if (myOutput.includes('FAILED test targets') === true) { - core.setFailed('There are failed tests') - } + await installDependencyAndSetup() + setSpec() + process.env.BUILD_LIST = buildList + if (!('TEST_JDK_HOME' in process.env)) + process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource) + + await getAqaTestsRepo(aqatestsRepo) + await runGetSh(tkgRepo, openj9Repo, vendorTestParams) + + //Get Dependencies, using /*zip*/dependents.zip to avoid loop every available files + let dependents = await tc.downloadTool( + 'https://ci.adoptopenjdk.net/view/all/job/test.getDependency/lastSuccessfulBuild/artifact//*zip*/dependents.zip' + ) + + let sevenzexe = '7z' + if (fs.existsSync('/usr/bin/yum')) { + sevenzexe = '7za' + } + + // Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly + await exec.exec( + `${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib` + ) + + if (buildList.includes('system')) { + getAqaSystemTestsRepo(aqasystemtestsRepo); + getOpenj9SystemTestsRepo(openj9systemtestsRepo); + dependents = await tc.downloadTool( + 'https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip' + ) + // System.dependency has different levels of archive structures archive/systemtest_prereqs/*.* + // None of io.mv, io.cp and exec.exec can mv directories as expected (mv archive/ ./). Move subfolder systemtest_prereqs instead. + const dependentPath = await tc.extractZip( + dependents, + `${process.env.GITHUB_WORKSPACE}/` + ) + await io.mv( + `${dependentPath}/archive/systemtest_prereqs`, + `${process.env.GITHUB_WORKSPACE}/aqa-tests` + ) + await io.rmRF(`${dependentPath}/archive`) + } + + const options: ExecOptions = {} + let myOutput = '' + options.listeners = { + stdout: (data: Buffer) => { + myOutput += data.toString() + } + } + process.chdir('TKG') + try { + await exec.exec('make compile') + 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) + } + if (myOutput.includes('FAILED test targets') === true) { + core.setFailed('There are failed tests') + } } - + function getTestJdkHome(version: string, jdksource: string): string { - // Try JAVA_HOME first and then fall back to GITHUB actions default location - let javaHome = process.env[`JAVA_HOME_${version}_X64`] as string - if (javaHome === undefined) { - javaHome = process.env['JAVA_HOME'] as string - } - if (jdksource === 'install-jdk') { - // work with AdoptOpenJDK/install-sdk - if (`JDK_${version}` in process.env) { - javaHome = process.env[`JDK_${version}`] as string - } else { - javaHome = process.env.JAVA_HOME as string - } - } - // Remove spaces in Windows path and replace with a short name path, e.g. 'C:/Program Files/***' ->C:/Progra~1/*** - if (IS_WINDOWS && jdksource === 'github-hosted') { - javaHome = javaHome.replace(/Program Files/g, 'Progra~1') - } - if (javaHome === undefined) { - core.error('JDK could not be found') - } - return javaHome + // Try JAVA_HOME first and then fall back to GITHUB actions default location + let javaHome = process.env[`JAVA_HOME_${version}_X64`] as string + if (javaHome === undefined) { + javaHome = process.env['JAVA_HOME'] as string + } + if (jdksource === 'install-jdk') { + // work with AdoptOpenJDK/install-sdk + if (`JDK_${version}` in process.env) { + javaHome = process.env[`JDK_${version}`] as string + } else { + javaHome = process.env.JAVA_HOME as string + } + } + // Remove spaces in Windows path and replace with a short name path, e.g. 'C:/Program Files/***' ->C:/Progra~1/*** + if (IS_WINDOWS && jdksource === 'github-hosted') { + javaHome = javaHome.replace(/Program Files/g, 'Progra~1') + } + if (javaHome === undefined) { + core.error('JDK could not be found') + } + return javaHome } - + // This function is an alternative of extra install step in workflow or alternative install action. This could also be implemented as github action async function installDependencyAndSetup(): Promise { - if (IS_WINDOWS) { - const cygwinPath = 'C:\\cygwin64' - try { - if (!fs.existsSync(cygwinPath)) { - core.info(`if the cygwin exist?`) - await io.mkdirP('C:\\cygwin64') - await io.mkdirP('C:\\cygwin_packages') - await tc.downloadTool( - 'https://cygwin.com/setup-x86_64.exe', - 'C:\\temp\\cygwin.exe' - ) - await exec.exec(`C:\\temp\\cygwin.exe --packages wget,bsdtar,rsync,gnupg,git,autoconf,make,gcc-core,mingw64-x86_64-gcc-core,unzip,zip,cpio,curl,grep,perl --quiet-mode --download --local-install - --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin/ - --local-package-dir "C:\\cygwin_packages" - --root "C:\\cygwin64"`) - await exec.exec( - `C:/cygwin64/bin/git config --system core.autocrlf false` - ) - core.addPath(`C:\\cygwin64\\bin`) - } - } catch (error) { - core.warning(error.message) - } - const antContribFile = await tc.downloadTool( - `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` - ) - await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) - await io.cp( - `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, - `${process.env.ANT_HOME}\\lib` - ) - } else if (process.platform === 'darwin') { - await exec.exec('brew install ant-contrib') - await exec.exec('sudo sysctl -w kern.sysv.shmall=655360') - await exec.exec('sudo sysctl -w kern.sysv.shmmax=125839605760') - } else { - if (fs.existsSync('/usr/bin/apt-get')) { - // Debian Based - await exec.exec('sudo apt-get update') - await exec.exec('sudo apt-get install ant-contrib -y') - } else if (fs.existsSync('/usr/bin/yum')) { - // RPM Based - await exec.exec('sudo yum update -y') - await exec.exec('sudo yum install p7zip -y') - const antContribFile = await tc.downloadTool( - `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` - ) - await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) - await io.cp( - `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, - `${process.env.ANT_HOME}\\lib` - ) - } else if (fs.existsSync('/sbin/apk')) { - // Alpine Based - await exec.exec('apk update') - await exec.exec('apk add p7zip') - const antContribFile = await tc.downloadTool( - `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` - ) - await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) - await io.cp( - `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, - `${process.env.ANT_HOME}\\lib` - ) - } - //environment - if ('RUNNER_USER' in process.env) { - process.env['LOGNAME'] = process.env['RUNNER_USER'] - } else { - core.warning( - 'RUNNER_USER is not the GitHub Actions environment variables shell script. Container is configured differently. Please check the updated lists of environment variables.' - ) - } - - if (fs.existsSync('/usr/bin/apt-get')) { - //disable apport - await exec.exec('sudo service apport stop') - } - } + if (IS_WINDOWS) { + const cygwinPath = 'C:\\cygwin64' + try { + if (!fs.existsSync(cygwinPath)) { + core.info(`if the cygwin exist?`) + await io.mkdirP('C:\\cygwin64') + await io.mkdirP('C:\\cygwin_packages') + await tc.downloadTool( + 'https://cygwin.com/setup-x86_64.exe', + 'C:\\temp\\cygwin.exe' + ) + await exec.exec(`C:\\temp\\cygwin.exe --packages wget,bsdtar,rsync,gnupg,git,autoconf,make,gcc-core,mingw64-x86_64-gcc-core,unzip,zip,cpio,curl,grep,perl --quiet-mode --download --local-install + --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin/ + --local-package-dir "C:\\cygwin_packages" + --root "C:\\cygwin64"`) + await exec.exec( + `C:/cygwin64/bin/git config --system core.autocrlf false` + ) + core.addPath(`C:\\cygwin64\\bin`) + } + } catch (error) { + core.warning(error.message) + } + const antContribFile = await tc.downloadTool( + `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` + ) + await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) + await io.cp( + `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, + `${process.env.ANT_HOME}\\lib` + ) + } else if (process.platform === 'darwin') { + await exec.exec('brew install ant-contrib') + await exec.exec('sudo sysctl -w kern.sysv.shmall=655360') + await exec.exec('sudo sysctl -w kern.sysv.shmmax=125839605760') + } else { + if (fs.existsSync('/usr/bin/apt-get')) { + // Debian Based + await exec.exec('sudo apt-get update') + await exec.exec('sudo apt-get install ant-contrib -y') + } else if (fs.existsSync('/usr/bin/yum')) { + // RPM Based + await exec.exec('sudo yum update -y') + await exec.exec('sudo yum install p7zip -y') + const antContribFile = await tc.downloadTool( + `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` + ) + await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) + await io.cp( + `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, + `${process.env.ANT_HOME}\\lib` + ) + } else if (fs.existsSync('/sbin/apk')) { + // Alpine Based + await exec.exec('apk update') + await exec.exec('apk add p7zip') + const antContribFile = await tc.downloadTool( + `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` + ) + await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) + await io.cp( + `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, + `${process.env.ANT_HOME}\\lib` + ) + } + //environment + if ('RUNNER_USER' in process.env) { + process.env['LOGNAME'] = process.env['RUNNER_USER'] + } else { + core.warning( + 'RUNNER_USER is not the GitHub Actions environment variables shell script. Container is configured differently. Please check the updated lists of environment variables.' + ) + } + + if (fs.existsSync('/usr/bin/apt-get')) { + //disable apport + await exec.exec('sudo service apport stop') + } + } } - + function setSpec(): void { - if (IS_WINDOWS) { - process.env['SPEC'] = 'win_x86-64_cmprssptrs' - } else if (process.platform === 'darwin') { - process.env['SPEC'] = 'osx_x86-64_cmprssptrs' - } else { - process.env['SPEC'] = 'linux_x86-64_cmprssptrs' - } + if (IS_WINDOWS) { + process.env['SPEC'] = 'win_x86-64_cmprssptrs' + } else if (process.platform === 'darwin') { + process.env['SPEC'] = 'osx_x86-64_cmprssptrs' + } else { + process.env['SPEC'] = 'linux_x86-64_cmprssptrs' + } } - + async function getAqaTestsRepo(aqatestsRepo: string): Promise { - let repoBranch = ['adoptium/aqa-tests', 'master'] - if (aqatestsRepo.length !== 0) { - repoBranch = parseRepoBranch(aqatestsRepo) - } - await exec.exec( - `git clone --depth 1 -b ${repoBranch[1]} https://github.com/${repoBranch[0]}.git` - ) - process.chdir('aqa-tests') + let repoBranch = ['adoptium/aqa-tests', 'master'] + if (aqatestsRepo.length !== 0) { + repoBranch = parseRepoBranch(aqatestsRepo) + } + await exec.exec( + `git clone --depth 1 -b ${repoBranch[1]} https://github.com/${repoBranch[0]}.git` + ) + process.chdir('aqa-tests') } - +function getOpenj9SystemTestsRepo(openj9systemtestsRepo: string) { + let repoBranch = ['eclipse-openj9/openj9-systemtest', 'master']; + if (openj9systemtestsRepo.length !== 0) { + repoBranch = parseRepoBranch(openj9systemtestsRepo); + } + process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; + process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; +} + function getAqaSystemTestsRepo(aqasystemtestsRepo: string) { - let repoBranch = ['adoptium/aqa-systemtests', 'master'] - if (aqasystemtestsRepo.length !== 0) { - repoBranch = parseRepoBranch(aqasystemtestsRepo) - } - process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; - process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; + let repoBranch = ['adoptium/aqa-systemtests', 'master'] + if (aqasystemtestsRepo.length !== 0) { + repoBranch = parseRepoBranch(aqasystemtestsRepo) + } + process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; + process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; } - + async function runGetSh( - tkgRepo: string, - openj9Repo: string, - vendorTestParams: string + tkgRepo: string, + openj9Repo: string, + vendorTestParams: string ): Promise { - let parameters = '' - if (tkgRepo.length !== 0) { - const repoBranch = parseRepoBranch(tkgRepo) - parameters += `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git` - } - if (openj9Repo.length !== 0) { - const repoBranch = parseRepoBranch(openj9Repo) - parameters += ` --openj9_branch ${repoBranch[1]} --openj9_repo https://github.com/${repoBranch[0]}.git` - } - - if (IS_WINDOWS) { - await exec.exec(`bash ./get.sh ${parameters} ${vendorTestParams}`) - } else { - await exec.exec(`./get.sh ${parameters} ${vendorTestParams}`) - } + let parameters = '' + if (tkgRepo.length !== 0) { + const repoBranch = parseRepoBranch(tkgRepo) + parameters += `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git` + } + if (openj9Repo.length !== 0) { + const repoBranch = parseRepoBranch(openj9Repo) + parameters += ` --openj9_branch ${repoBranch[1]} --openj9_repo https://github.com/${repoBranch[0]}.git` + } + + if (IS_WINDOWS) { + await exec.exec(`bash ./get.sh ${parameters} ${vendorTestParams}`) + } else { + await exec.exec(`./get.sh ${parameters} ${vendorTestParams}`) + } } - + function parseRepoBranch(repoBranch: string): string[] { - const tempRepo = repoBranch.replace(/\s/g, '') - return tempRepo.split(':') + const tempRepo = repoBranch.replace(/\s/g, '') + return tempRepo.split(':') } + + From 94fe28a411b616423d0738968a2d99cb978ab279 Mon Sep 17 00:00:00 2001 From: Nandini-4120 <78912133+Nandini-4120@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:18:03 +0530 Subject: [PATCH 2/5] New commits --- action.yml | 1 - src/aqa.ts | 154 ++++++++-------- src/runaqa.ts | 496 +++++++++++++++++++++++++------------------------- 3 files changed, 323 insertions(+), 328 deletions(-) diff --git a/action.yml b/action.yml index 3e5bd1f..c74813f 100644 --- a/action.yml +++ b/action.yml @@ -30,7 +30,6 @@ inputs: openj9-systemtestsRepo: description: 'Personal openj9-systemtests Repo' required: false - default: 'openj9-systemtests:master' tkg_Repo: description: 'Personal TKG Repo. For example, octocat/TKG:test' required: false diff --git a/src/aqa.ts b/src/aqa.ts index 8da3830..8187bf4 100644 --- a/src/aqa.ts +++ b/src/aqa.ts @@ -1,83 +1,81 @@ import * as core from '@actions/core' import * as runaqa from './runaqa' - async function run(): Promise { - try { - const jdksource = core.getInput('jdksource', {required: false}) - 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}) - const aqatestsRepo = core.getInput('aqa-testsRepo', {required: false}) - const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}) - const openj9Repo = core.getInput('openj9_repo', {required: false}) - const openj9systemtestsRepo = core.getInput('openj9-systemtestsRepo', { required: false }); - const tkgRepo = core.getInput('tkg_Repo', {required: false}) - const vendorTestRepos = core.getInput('vendor_testRepos', {required: false}) - const vendorTestBranches = core.getInput('vendor_testBranches', { - required: false - }) - const vendorTestDirs = core.getInput('vendor_testDirs', {required: false}) - const vendorTestShas = core.getInput('vendor_testShas', {required: false}) - - let vendorTestParams = '' - // let arch = core.getInput("architecture", { required: false }) - if ( - jdksource !== 'upstream' && - jdksource !== 'github-hosted' && - jdksource !== 'install-jdk' - ) { - core.error( - `jdksource should be one of [upstream, github-hosted, install-jdk]. Found: ${jdksource}` - ) - } - - if ( - buildList !== 'openjdk' && - !buildList.startsWith('external') && - !buildList.startsWith('functional') && - !buildList.startsWith('perf') && - !buildList.startsWith('system') - ) { - core.setFailed( - `buildList should be one of or sub dir of [openjdk, external, functional, system, perf]. Found: ${buildList}` - ) - } - if (jdksource !== 'upstream' && version.length === 0) { - core.setFailed( - 'Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.' - ) - } - if (vendorTestRepos !== '') { - vendorTestParams = `--vendor_repos ${vendorTestRepos}` - } - if (vendorTestBranches !== '') { - vendorTestParams += ` --vendor_branches ${vendorTestBranches}` - } - if (vendorTestDirs !== '') { - vendorTestParams += ` --vendor_dirs ${vendorTestDirs}` - } - if (vendorTestShas !== '') { - vendorTestParams += ` --vendor_shas ${vendorTestShas}` - } - await runaqa.runaqaTest( - version, - jdksource, - buildList, - target, - customTarget, - aqatestsRepo, - openj9Repo, - tkgRepo, - vendorTestParams, - aqasystemtestsRepo, - openj9systemtestsRepo, - ) - } catch (error) { - core.setFailed(error.message) - } +async function run(): Promise { + try { + const jdksource = core.getInput('jdksource', {required: false}) + 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}) + const aqatestsRepo = core.getInput('aqa-testsRepo', {required: false}) + const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}) + const openj9Repo = core.getInput('openj9_repo', {required: false}) + const openj9systemtestsRepo=core.getInput('openj9-systemtestsRepo', {required: false}) + const tkgRepo = core.getInput('tkg_Repo', {required: false}) + const vendorTestRepos = core.getInput('vendor_testRepos', {required: false}) + const vendorTestBranches = core.getInput('vendor_testBranches', { + required: false + }) + const vendorTestDirs = core.getInput('vendor_testDirs', {required: false}) + const vendorTestShas = core.getInput('vendor_testShas', {required: false}) + + let vendorTestParams = '' + // let arch = core.getInput("architecture", { required: false }) + if ( + jdksource !== 'upstream' && + jdksource !== 'github-hosted' && + jdksource !== 'install-jdk' + ) { + core.error( + `jdksource should be one of [upstream, github-hosted, install-jdk]. Found: ${jdksource}` + ) + } + + if ( + buildList !== 'openjdk' && + !buildList.startsWith('external') && + !buildList.startsWith('functional') && + !buildList.startsWith('perf') && + !buildList.startsWith('system') + ) { + core.setFailed( + `buildList should be one of or sub dir of [openjdk, external, functional, system, perf]. Found: ${buildList}` + ) + } + if (jdksource !== 'upstream' && version.length === 0) { + core.setFailed( + 'Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.' + ) + } + if (vendorTestRepos !== '') { + vendorTestParams = `--vendor_repos ${vendorTestRepos}` + } + if (vendorTestBranches !== '') { + vendorTestParams += ` --vendor_branches ${vendorTestBranches}` + } + if (vendorTestDirs !== '') { + vendorTestParams += ` --vendor_dirs ${vendorTestDirs}` + } + if (vendorTestShas !== '') { + vendorTestParams += ` --vendor_shas ${vendorTestShas}` + } + await runaqa.runaqaTest( + version, + jdksource, + buildList, + target, + customTarget, + aqatestsRepo, + openj9Repo, + tkgRepo, + vendorTestParams, + aqasystemtestsRepo, + openj9systemtestsRepo, + ) + } catch (error) { + core.setFailed(error.message) + } } - -run() - +run() diff --git a/src/runaqa.ts b/src/runaqa.ts index 15f43ed..04f75b9 100644 --- a/src/runaqa.ts +++ b/src/runaqa.ts @@ -5,276 +5,274 @@ import * as tc from '@actions/tool-cache' import * as path from 'path' import * as fs from 'fs' import {ExecOptions} from '@actions/exec/lib/interfaces' - + let tempDirectory = process.env['RUNNER_TEMP'] || '' const IS_WINDOWS = process.platform === 'win32' - + if (!tempDirectory) { - let baseLocation - - if (IS_WINDOWS) { - // On windows use the USERPROFILE env variable - baseLocation = process.env['USERPROFILE'] || 'C:\\' - } else if (process.platform === 'darwin') { - baseLocation = '/Users' - } else { - baseLocation = '/home' - } - tempDirectory = path.join(baseLocation, 'actions', 'temp') + let baseLocation + + if (IS_WINDOWS) { + // On windows use the USERPROFILE env variable + baseLocation = process.env['USERPROFILE'] || 'C:\\' + } else if (process.platform === 'darwin') { + baseLocation = '/Users' + } else { + baseLocation = '/home' + } + tempDirectory = path.join(baseLocation, 'actions', 'temp') } - + export async function runaqaTest( - version: string, - jdksource: string, - buildList: string, - target: string, - customTarget: string, - aqatestsRepo: string, - openj9Repo: string, - tkgRepo: string, - vendorTestParams: string, - aqasystemtestsRepo: string, - openj9systemtestsRepo: string, + version: string, + jdksource: string, + buildList: string, + target: string, + customTarget: string, + aqatestsRepo: string, + openj9Repo: string, + tkgRepo: string, + vendorTestParams: string, + aqasystemtestsRepo: string, + openj9systemtestsRepo: string, ): Promise { - await installDependencyAndSetup() - setSpec() - process.env.BUILD_LIST = buildList - if (!('TEST_JDK_HOME' in process.env)) - process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource) - - await getAqaTestsRepo(aqatestsRepo) - await runGetSh(tkgRepo, openj9Repo, vendorTestParams) - - //Get Dependencies, using /*zip*/dependents.zip to avoid loop every available files - let dependents = await tc.downloadTool( - 'https://ci.adoptopenjdk.net/view/all/job/test.getDependency/lastSuccessfulBuild/artifact//*zip*/dependents.zip' - ) - - let sevenzexe = '7z' - if (fs.existsSync('/usr/bin/yum')) { - sevenzexe = '7za' - } - - // Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly - await exec.exec( - `${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib` - ) - - if (buildList.includes('system')) { - getAqaSystemTestsRepo(aqasystemtestsRepo); - getOpenj9SystemTestsRepo(openj9systemtestsRepo); - dependents = await tc.downloadTool( - 'https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip' - ) - // System.dependency has different levels of archive structures archive/systemtest_prereqs/*.* - // None of io.mv, io.cp and exec.exec can mv directories as expected (mv archive/ ./). Move subfolder systemtest_prereqs instead. - const dependentPath = await tc.extractZip( - dependents, - `${process.env.GITHUB_WORKSPACE}/` - ) - await io.mv( - `${dependentPath}/archive/systemtest_prereqs`, - `${process.env.GITHUB_WORKSPACE}/aqa-tests` - ) - await io.rmRF(`${dependentPath}/archive`) - } - - const options: ExecOptions = {} - let myOutput = '' - options.listeners = { - stdout: (data: Buffer) => { - myOutput += data.toString() - } - } - process.chdir('TKG') - try { - await exec.exec('make compile') - 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) - } - if (myOutput.includes('FAILED test targets') === true) { - core.setFailed('There are failed tests') - } + await installDependencyAndSetup() + setSpec() + process.env.BUILD_LIST = buildList + if (!('TEST_JDK_HOME' in process.env)) + process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource) + + await getAqaTestsRepo(aqatestsRepo) + await runGetSh(tkgRepo, openj9Repo, vendorTestParams) + + //Get Dependencies, using /*zip*/dependents.zip to avoid loop every available files + let dependents = await tc.downloadTool( + 'https://ci.adoptopenjdk.net/view/all/job/test.getDependency/lastSuccessfulBuild/artifact//*zip*/dependents.zip' + ) + + let sevenzexe = '7z' + if (fs.existsSync('/usr/bin/yum')) { + sevenzexe = '7za' + } + + // Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly + await exec.exec( + `${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib` + ) + + if (buildList.includes('system')) { + getAqaSystemTestsRepo(aqasystemtestsRepo); + getOpenj9SystemTestsRepo(openj9systemtestsRepo); + dependents = await tc.downloadTool( + 'https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip' + ) + // System.dependency has different levels of archive structures archive/systemtest_prereqs/*.* + // None of io.mv, io.cp and exec.exec can mv directories as expected (mv archive/ ./). Move subfolder systemtest_prereqs instead. + const dependentPath = await tc.extractZip( + dependents, + `${process.env.GITHUB_WORKSPACE}/` + ) + await io.mv( + `${dependentPath}/archive/systemtest_prereqs`, + `${process.env.GITHUB_WORKSPACE}/aqa-tests` + ) + await io.rmRF(`${dependentPath}/archive`) + } + + const options: ExecOptions = {} + let myOutput = '' + options.listeners = { + stdout: (data: Buffer) => { + myOutput += data.toString() + } + } + process.chdir('TKG') + try { + await exec.exec('make compile') + 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) + } + if (myOutput.includes('FAILED test targets') === true) { + core.setFailed('There are failed tests') + } } - + function getTestJdkHome(version: string, jdksource: string): string { - // Try JAVA_HOME first and then fall back to GITHUB actions default location - let javaHome = process.env[`JAVA_HOME_${version}_X64`] as string - if (javaHome === undefined) { - javaHome = process.env['JAVA_HOME'] as string - } - if (jdksource === 'install-jdk') { - // work with AdoptOpenJDK/install-sdk - if (`JDK_${version}` in process.env) { - javaHome = process.env[`JDK_${version}`] as string - } else { - javaHome = process.env.JAVA_HOME as string - } - } - // Remove spaces in Windows path and replace with a short name path, e.g. 'C:/Program Files/***' ->C:/Progra~1/*** - if (IS_WINDOWS && jdksource === 'github-hosted') { - javaHome = javaHome.replace(/Program Files/g, 'Progra~1') - } - if (javaHome === undefined) { - core.error('JDK could not be found') - } - return javaHome + // Try JAVA_HOME first and then fall back to GITHUB actions default location + let javaHome = process.env[`JAVA_HOME_${version}_X64`] as string + if (javaHome === undefined) { + javaHome = process.env['JAVA_HOME'] as string + } + if (jdksource === 'install-jdk') { + // work with AdoptOpenJDK/install-sdk + if (`JDK_${version}` in process.env) { + javaHome = process.env[`JDK_${version}`] as string + } else { + javaHome = process.env.JAVA_HOME as string + } + } + // Remove spaces in Windows path and replace with a short name path, e.g. 'C:/Program Files/***' ->C:/Progra~1/*** + if (IS_WINDOWS && jdksource === 'github-hosted') { + javaHome = javaHome.replace(/Program Files/g, 'Progra~1') + } + if (javaHome === undefined) { + core.error('JDK could not be found') + } + return javaHome } - + // This function is an alternative of extra install step in workflow or alternative install action. This could also be implemented as github action async function installDependencyAndSetup(): Promise { - if (IS_WINDOWS) { - const cygwinPath = 'C:\\cygwin64' - try { - if (!fs.existsSync(cygwinPath)) { - core.info(`if the cygwin exist?`) - await io.mkdirP('C:\\cygwin64') - await io.mkdirP('C:\\cygwin_packages') - await tc.downloadTool( - 'https://cygwin.com/setup-x86_64.exe', - 'C:\\temp\\cygwin.exe' - ) - await exec.exec(`C:\\temp\\cygwin.exe --packages wget,bsdtar,rsync,gnupg,git,autoconf,make,gcc-core,mingw64-x86_64-gcc-core,unzip,zip,cpio,curl,grep,perl --quiet-mode --download --local-install - --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin/ - --local-package-dir "C:\\cygwin_packages" - --root "C:\\cygwin64"`) - await exec.exec( - `C:/cygwin64/bin/git config --system core.autocrlf false` - ) - core.addPath(`C:\\cygwin64\\bin`) - } - } catch (error) { - core.warning(error.message) - } - const antContribFile = await tc.downloadTool( - `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` - ) - await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) - await io.cp( - `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, - `${process.env.ANT_HOME}\\lib` - ) - } else if (process.platform === 'darwin') { - await exec.exec('brew install ant-contrib') - await exec.exec('sudo sysctl -w kern.sysv.shmall=655360') - await exec.exec('sudo sysctl -w kern.sysv.shmmax=125839605760') - } else { - if (fs.existsSync('/usr/bin/apt-get')) { - // Debian Based - await exec.exec('sudo apt-get update') - await exec.exec('sudo apt-get install ant-contrib -y') - } else if (fs.existsSync('/usr/bin/yum')) { - // RPM Based - await exec.exec('sudo yum update -y') - await exec.exec('sudo yum install p7zip -y') - const antContribFile = await tc.downloadTool( - `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` - ) - await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) - await io.cp( - `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, - `${process.env.ANT_HOME}\\lib` - ) - } else if (fs.existsSync('/sbin/apk')) { - // Alpine Based - await exec.exec('apk update') - await exec.exec('apk add p7zip') - const antContribFile = await tc.downloadTool( - `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` - ) - await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) - await io.cp( - `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, - `${process.env.ANT_HOME}\\lib` - ) - } - //environment - if ('RUNNER_USER' in process.env) { - process.env['LOGNAME'] = process.env['RUNNER_USER'] - } else { - core.warning( - 'RUNNER_USER is not the GitHub Actions environment variables shell script. Container is configured differently. Please check the updated lists of environment variables.' - ) - } - - if (fs.existsSync('/usr/bin/apt-get')) { - //disable apport - await exec.exec('sudo service apport stop') - } - } + if (IS_WINDOWS) { + const cygwinPath = 'C:\\cygwin64' + try { + if (!fs.existsSync(cygwinPath)) { + core.info(`if the cygwin exist?`) + await io.mkdirP('C:\\cygwin64') + await io.mkdirP('C:\\cygwin_packages') + await tc.downloadTool( + 'https://cygwin.com/setup-x86_64.exe', + 'C:\\temp\\cygwin.exe' + ) + await exec.exec(`C:\\temp\\cygwin.exe --packages wget,bsdtar,rsync,gnupg,git,autoconf,make,gcc-core,mingw64-x86_64-gcc-core,unzip,zip,cpio,curl,grep,perl --quiet-mode --download --local-install + --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin/ + --local-package-dir "C:\\cygwin_packages" + --root "C:\\cygwin64"`) + await exec.exec( + `C:/cygwin64/bin/git config --system core.autocrlf false` + ) + core.addPath(`C:\\cygwin64\\bin`) + } + } catch (error) { + core.warning(error.message) + } + const antContribFile = await tc.downloadTool( + `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` + ) + await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) + await io.cp( + `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, + `${process.env.ANT_HOME}\\lib` + ) + } else if (process.platform === 'darwin') { + await exec.exec('brew install ant-contrib') + await exec.exec('sudo sysctl -w kern.sysv.shmall=655360') + await exec.exec('sudo sysctl -w kern.sysv.shmmax=125839605760') + } else { + if (fs.existsSync('/usr/bin/apt-get')) { + // Debian Based + await exec.exec('sudo apt-get update') + await exec.exec('sudo apt-get install ant-contrib -y') + } else if (fs.existsSync('/usr/bin/yum')) { + // RPM Based + await exec.exec('sudo yum update -y') + await exec.exec('sudo yum install p7zip -y') + const antContribFile = await tc.downloadTool( + `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` + ) + await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) + await io.cp( + `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, + `${process.env.ANT_HOME}\\lib` + ) + } else if (fs.existsSync('/sbin/apk')) { + // Alpine Based + await exec.exec('apk update') + await exec.exec('apk add p7zip') + const antContribFile = await tc.downloadTool( + `https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download` + ) + await tc.extractZip(`${antContribFile}`, `${tempDirectory}`) + await io.cp( + `${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, + `${process.env.ANT_HOME}\\lib` + ) + } + //environment + if ('RUNNER_USER' in process.env) { + process.env['LOGNAME'] = process.env['RUNNER_USER'] + } else { + core.warning( + 'RUNNER_USER is not the GitHub Actions environment variables shell script. Container is configured differently. Please check the updated lists of environment variables.' + ) + } + + if (fs.existsSync('/usr/bin/apt-get')) { + //disable apport + await exec.exec('sudo service apport stop') + } + } } - + function setSpec(): void { - if (IS_WINDOWS) { - process.env['SPEC'] = 'win_x86-64_cmprssptrs' - } else if (process.platform === 'darwin') { - process.env['SPEC'] = 'osx_x86-64_cmprssptrs' - } else { - process.env['SPEC'] = 'linux_x86-64_cmprssptrs' - } + if (IS_WINDOWS) { + process.env['SPEC'] = 'win_x86-64_cmprssptrs' + } else if (process.platform === 'darwin') { + process.env['SPEC'] = 'osx_x86-64_cmprssptrs' + } else { + process.env['SPEC'] = 'linux_x86-64_cmprssptrs' + } } - + async function getAqaTestsRepo(aqatestsRepo: string): Promise { - let repoBranch = ['adoptium/aqa-tests', 'master'] - if (aqatestsRepo.length !== 0) { - repoBranch = parseRepoBranch(aqatestsRepo) - } - await exec.exec( - `git clone --depth 1 -b ${repoBranch[1]} https://github.com/${repoBranch[0]}.git` - ) - process.chdir('aqa-tests') + let repoBranch = ['adoptium/aqa-tests', 'master'] + if (aqatestsRepo.length !== 0) { + repoBranch = parseRepoBranch(aqatestsRepo) + } + await exec.exec( + `git clone --depth 1 -b ${repoBranch[1]} https://github.com/${repoBranch[0]}.git` + ) + process.chdir('aqa-tests') +} + +function getOpenj9SystemTestsRepo(openj9systemtestsRepo: string){ +let repoBranch=['eclipse-openj9/openj9-systemtest','master']; +if(openj9systemtestsRepo.length!==0){ + repoBranch=parseRepoBranch(openj9systemtestsRepo); } -function getOpenj9SystemTestsRepo(openj9systemtestsRepo: string) { - let repoBranch = ['eclipse-openj9/openj9-systemtest', 'master']; - if (openj9systemtestsRepo.length !== 0) { - repoBranch = parseRepoBranch(openj9systemtestsRepo); - } - process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; - process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; +process.env.OPENJ9_SYSTEMTEST_REPO = repoBranch[0]; +process.env.OPENJ9_SYSTEMTEST_BRANCH = repoBranch[1]; } - function getAqaSystemTestsRepo(aqasystemtestsRepo: string) { - let repoBranch = ['adoptium/aqa-systemtests', 'master'] - if (aqasystemtestsRepo.length !== 0) { - repoBranch = parseRepoBranch(aqasystemtestsRepo) - } - process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; - process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; + let repoBranch = ['adoptium/aqa-systemtests', 'master'] + if (aqasystemtestsRepo.length !== 0) { + repoBranch = parseRepoBranch(aqasystemtestsRepo) + } + process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0]; + process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1]; } - + async function runGetSh( - tkgRepo: string, - openj9Repo: string, - vendorTestParams: string + tkgRepo: string, + openj9Repo: string, + vendorTestParams: string ): Promise { - let parameters = '' - if (tkgRepo.length !== 0) { - const repoBranch = parseRepoBranch(tkgRepo) - parameters += `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git` - } - if (openj9Repo.length !== 0) { - const repoBranch = parseRepoBranch(openj9Repo) - parameters += ` --openj9_branch ${repoBranch[1]} --openj9_repo https://github.com/${repoBranch[0]}.git` - } - - if (IS_WINDOWS) { - await exec.exec(`bash ./get.sh ${parameters} ${vendorTestParams}`) - } else { - await exec.exec(`./get.sh ${parameters} ${vendorTestParams}`) - } + let parameters = '' + if (tkgRepo.length !== 0) { + const repoBranch = parseRepoBranch(tkgRepo) + parameters += `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git` + } + if (openj9Repo.length !== 0) { + const repoBranch = parseRepoBranch(openj9Repo) + parameters += ` --openj9_branch ${repoBranch[1]} --openj9_repo https://github.com/${repoBranch[0]}.git` + } + + if (IS_WINDOWS) { + await exec.exec(`bash ./get.sh ${parameters} ${vendorTestParams}`) + } else { + await exec.exec(`./get.sh ${parameters} ${vendorTestParams}`) + } } - + function parseRepoBranch(repoBranch: string): string[] { - const tempRepo = repoBranch.replace(/\s/g, '') - return tempRepo.split(':') + const tempRepo = repoBranch.replace(/\s/g, '') + return tempRepo.split(':') } - - From aa8daf6c00c129ef281788e5d2a4aa269f6774ab Mon Sep 17 00:00:00 2001 From: Nandini-4120 <78912133+Nandini-4120@users.noreply.github.com> Date: Thu, 3 Feb 2022 19:33:06 +0530 Subject: [PATCH 3/5] resolved --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5aee1c1..979b3ff 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,10 @@ You can also: | version | 8 | | build_list | openjdk | | target | _jdk_math | +<<<<<<< HEAD | custom_target | | +======= +>>>>>>> 0aaf44c (Update README.md) | jdksource | upstream | | aqa-testsRepo | | | tkg_Repo | | From 4f0273ee43ecb635ec1a16105fe7cef4e00bd4d1 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Mon, 11 May 2020 21:28:17 -0400 Subject: [PATCH 4/5] support custom_target :x --- .github/workflows/test.yml | 6 ++++++ .github/workflows/testcustom.yml | 25 +++++++++++++++++++++++++ .github/workflows/testexample.yml | 24 ++++++++++++++++++++++++ .project | 11 +++++++++++ action.yml | 6 ++++++ dist/index.js | 22 ++++++++++++++++++++++ src/aqa.ts | 9 +++++++++ src/runaqa.ts | 14 ++++++++++++++ 8 files changed, 117 insertions(+) create mode 100644 .github/workflows/testcustom.yml create mode 100644 .github/workflows/testexample.yml create mode 100644 .project diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dba86d..7185994 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,16 @@ name: "run-aqa build with push to master" on: push: +<<<<<<< HEAD branches: - master pull_request: types: [opened, synchronize, reopened, ready_for_review] +======= + branches-ignore: + - '**' + +>>>>>>> 79a6303 (support custom_target) jobs: openjdk: # make sure build/ci work properly runs-on: ${{ matrix.os }} diff --git a/.github/workflows/testcustom.yml b/.github/workflows/testcustom.yml new file mode 100644 index 0000000..378fcc8 --- /dev/null +++ b/.github/workflows/testcustom.yml @@ -0,0 +1,25 @@ +name: "build-test" +on: # rebuild any PRs and main branch changes + push: + +jobs: + build: # make sure build/ci work properly + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v1 + - uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '11' + targets: 'JDK_11' + - name: AQA + uses: ./ + with: + version: '11' + jdksource: 'install-jdk' + build_list: 'openjdk' + target: '_jdk_custom' + custom_target: 'test/jdk/java/math/BigInteger/BigIntegerTest.java' diff --git a/.github/workflows/testexample.yml b/.github/workflows/testexample.yml new file mode 100644 index 0000000..5f4ca00 --- /dev/null +++ b/.github/workflows/testexample.yml @@ -0,0 +1,24 @@ +name: "build-test" +on: # rebuild any PRs and main branch changes + push: + +jobs: + build: # make sure build/ci work properly + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] #[ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v1 + - uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '11' + targets: 'JDK_11' + - name: AQA + uses: ./ + with: + version: '11' + jdksource: 'install-jdk' + build_list: 'openjdk' + target: '_jdk_custom' diff --git a/.project b/.project new file mode 100644 index 0000000..c4660bd --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + run-aqa + + + + + + + + diff --git a/action.yml b/action.yml index c74813f..ac8288c 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,7 @@ inputs: target: # test description: default: '_jdk_math' +<<<<<<< HEAD custom_target: # Used if need to set non-default custom target description: required: false @@ -45,6 +46,11 @@ inputs: vendor_testShas: description: 'Comma-separated list of vendor SHAs' required: false +======= + custom_target: + description: + required: false +>>>>>>> 79a6303 (support custom_target) runs: using: 'node12' main: 'dist/index.js' \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 8d1fec0..5985760 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2953,6 +2953,7 @@ function run() { const buildList = core.getInput('build_list', { required: false }); const target = core.getInput('target', { required: false }); const customTarget = core.getInput('custom_target', { required: false }); +<<<<<<< HEAD const aqatestsRepo = core.getInput('aqa-testsRepo', { required: false }); const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}); const openj9Repo = core.getInput('openj9_repo', { required: false }); @@ -2965,6 +2966,8 @@ function run() { const vendorTestDirs = core.getInput('vendor_testDirs', { required: false }); const vendorTestShas = core.getInput('vendor_testShas', { required: false }); let vendorTestParams = ''; +======= +>>>>>>> 79a6303 (support custom_target) // let arch = core.getInput("architecture", { required: false }) if (jdksource !== 'upstream' && jdksource !== 'github-hosted' && @@ -2981,6 +2984,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.'); } +<<<<<<< HEAD if (vendorTestRepos !== '') { vendorTestParams = `--vendor_repos ${vendorTestRepos}`; } @@ -2994,6 +2998,9 @@ function run() { vendorTestParams += ` --vendor_shas ${vendorTestShas}`; } yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo,openj9systemtestsRepo); +======= + yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget); +>>>>>>> 79a6303 (support custom_target) } catch (error) { core.setFailed(error.message); @@ -3378,6 +3385,7 @@ const core = __importStar(__webpack_require__(470)); const io = __importStar(__webpack_require__(1)); const tc = __importStar(__webpack_require__(533)); const path = __importStar(__webpack_require__(622)); +<<<<<<< HEAD const fs = __importStar(__webpack_require__(747)); let tempDirectory = process.env['RUNNER_TEMP'] || ''; const IS_WINDOWS = process.platform === 'win32'; @@ -3399,6 +3407,16 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, aqatest return __awaiter(this, void 0, void 0, function* () { yield installDependencyAndSetup(); setSpec(); +======= +const isWindows = process.platform === 'win32'; +function runaqaTest(version, jdksource, buildList, target, customTarget) { + return __awaiter(this, void 0, void 0, function* () { + yield installDependency(); + let customOption = ''; + if (target.includes('custom') && customTarget !== '') { + customOption = `${target.toUpperCase()}_TARGET=${customTarget}`; + } +>>>>>>> 79a6303 (support custom_target) process.env.BUILD_LIST = buildList; if (!('TEST_JDK_HOME' in process.env)) process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource); @@ -3433,6 +3451,7 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, aqatest process.chdir('TKG'); try { yield exec.exec('make compile'); +<<<<<<< HEAD if (target.includes('custom') && customTarget !== '') { const customOption = `${target .substr(1) @@ -3442,6 +3461,9 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, aqatest else { yield exec.exec('make', [`${target}`], options); } +======= + yield exec.exec('make', [`${target} ${customOption}`], options); +>>>>>>> 79a6303 (support custom_target) } catch (error) { core.setFailed(error.message); diff --git a/src/aqa.ts b/src/aqa.ts index 8187bf4..00d66b9 100644 --- a/src/aqa.ts +++ b/src/aqa.ts @@ -7,6 +7,7 @@ async function run(): Promise { const version = core.getInput('version', {required: false}) const buildList = core.getInput('build_list', {required: false}) const target = core.getInput('target', {required: false}) +<<<<<<< HEAD const customTarget = core.getInput('custom_target', {required: false}) const aqatestsRepo = core.getInput('aqa-testsRepo', {required: false}) const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false}) @@ -21,6 +22,9 @@ async function run(): Promise { const vendorTestShas = core.getInput('vendor_testShas', {required: false}) let vendorTestParams = '' +======= + const customTarget = core.getInput('custom_target',{required: false}) +>>>>>>> 79a6303 (support custom_target) // let arch = core.getInput("architecture", { required: false }) if ( jdksource !== 'upstream' && @@ -48,6 +52,7 @@ async function run(): Promise { 'Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.' ) } +<<<<<<< HEAD if (vendorTestRepos !== '') { vendorTestParams = `--vendor_repos ${vendorTestRepos}` } @@ -73,6 +78,10 @@ async function run(): Promise { aqasystemtestsRepo, openj9systemtestsRepo, ) +======= + + await runaqa.runaqaTest(version, jdksource, buildList, target, customTarget) +>>>>>>> 79a6303 (support custom_target) } catch (error) { core.setFailed(error.message) } diff --git a/src/runaqa.ts b/src/runaqa.ts index 04f75b9..cd557d1 100644 --- a/src/runaqa.ts +++ b/src/runaqa.ts @@ -28,6 +28,7 @@ export async function runaqaTest( jdksource: string, buildList: string, target: string, +<<<<<<< HEAD customTarget: string, aqatestsRepo: string, openj9Repo: string, @@ -38,6 +39,15 @@ export async function runaqaTest( ): Promise { await installDependencyAndSetup() setSpec() +======= + customTarget: string +): Promise { + await installDependency() + let customOption = '' + if (target.includes('custom') && customTarget !== '') { + customOption = `${target.toUpperCase()}_TARGET=${customTarget}` + } +>>>>>>> 79a6303 (support custom_target) process.env.BUILD_LIST = buildList if (!('TEST_JDK_HOME' in process.env)) process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource) @@ -89,6 +99,7 @@ export async function runaqaTest( process.chdir('TKG') try { await exec.exec('make compile') +<<<<<<< HEAD if (target.includes('custom') && customTarget !== '') { const customOption = `${target .substr(1) @@ -97,6 +108,9 @@ export async function runaqaTest( } else { await exec.exec('make', [`${target}`], options) } +======= + await exec.exec('make', [`${target} ${customOption}`], options) +>>>>>>> 79a6303 (support custom_target) } catch (error) { core.setFailed(error.message) } From 524226bf7c15532e5f485c72e4f9b7426704cbc1 Mon Sep 17 00:00:00 2001 From: Nandini-4120 <78912133+Nandini-4120@users.noreply.github.com> Date: Thu, 3 Feb 2022 19:51:15 +0530 Subject: [PATCH 5/5] Added openj9-systemtests repo options Fixes:#107 Signed-off-by : Nandini Taneja Signed-off-by: Somya Tomar Signed-off-by: Nandini-4120 <78912133+Nandini-4120@users.noreply.github.com> --- .github/workflows/testcustom.yml | 25 ------------------------- .github/workflows/testexample.yml | 24 ------------------------ .project | 11 ----------- README.md | 5 +++++ action.yml | 4 ++++ dist/index.js | 11 +++++++++++ src/runaqa.ts | 11 +++++++++++ 7 files changed, 31 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/testcustom.yml delete mode 100644 .github/workflows/testexample.yml delete mode 100644 .project diff --git a/.github/workflows/testcustom.yml b/.github/workflows/testcustom.yml deleted file mode 100644 index 378fcc8..0000000 --- a/.github/workflows/testcustom.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "build-test" -on: # rebuild any PRs and main branch changes - push: - -jobs: - build: # make sure build/ci work properly - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - uses: AdoptOpenJDK/install-jdk@v1 - with: - version: '11' - targets: 'JDK_11' - - name: AQA - uses: ./ - with: - version: '11' - jdksource: 'install-jdk' - build_list: 'openjdk' - target: '_jdk_custom' - custom_target: 'test/jdk/java/math/BigInteger/BigIntegerTest.java' diff --git a/.github/workflows/testexample.yml b/.github/workflows/testexample.yml deleted file mode 100644 index 5f4ca00..0000000 --- a/.github/workflows/testexample.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "build-test" -on: # rebuild any PRs and main branch changes - push: - -jobs: - build: # make sure build/ci work properly - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] #[ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - uses: AdoptOpenJDK/install-jdk@v1 - with: - version: '11' - targets: 'JDK_11' - - name: AQA - uses: ./ - with: - version: '11' - jdksource: 'install-jdk' - build_list: 'openjdk' - target: '_jdk_custom' diff --git a/.project b/.project deleted file mode 100644 index c4660bd..0000000 --- a/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - run-aqa - - - - - - - - diff --git a/README.md b/README.md index 979b3ff..cbf51c2 100644 --- a/README.md +++ b/README.md @@ -92,13 +92,18 @@ You can also: | build_list | openjdk | | target | _jdk_math | <<<<<<< HEAD +<<<<<<< HEAD | custom_target | | ======= >>>>>>> 0aaf44c (Update README.md) +======= +| custom_target | | +>>>>>>> 43100af (support custom_target) | jdksource | upstream | | aqa-testsRepo | | | tkg_Repo | | + ### 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`. diff --git a/action.yml b/action.yml index ac8288c..5ca9fd6 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,7 @@ inputs: target: # test description: default: '_jdk_math' +<<<<<<< HEAD <<<<<<< HEAD custom_target: # Used if need to set non-default custom target description: @@ -48,6 +49,9 @@ inputs: required: false ======= custom_target: +======= + custom_target: # Used if need to set non-default custom target +>>>>>>> 43100af (support custom_target) description: required: false >>>>>>> 79a6303 (support custom_target) diff --git a/dist/index.js b/dist/index.js index 5985760..a9fb4c0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3412,11 +3412,14 @@ const isWindows = process.platform === 'win32'; function runaqaTest(version, jdksource, buildList, target, customTarget) { return __awaiter(this, void 0, void 0, function* () { yield installDependency(); +<<<<<<< HEAD let customOption = ''; if (target.includes('custom') && customTarget !== '') { customOption = `${target.toUpperCase()}_TARGET=${customTarget}`; } >>>>>>> 79a6303 (support custom_target) +======= +>>>>>>> 43100af (support custom_target) process.env.BUILD_LIST = buildList; if (!('TEST_JDK_HOME' in process.env)) process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource); @@ -3451,19 +3454,27 @@ function runaqaTest(version, jdksource, buildList, target, customTarget) { process.chdir('TKG'); try { yield exec.exec('make compile'); +<<<<<<< HEAD <<<<<<< HEAD if (target.includes('custom') && customTarget !== '') { const customOption = `${target .substr(1) .toUpperCase()}_TARGET=${customTarget}`; +======= + if (target.includes('custom') && customTarget !== '') { + const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`; +>>>>>>> 43100af (support custom_target) yield exec.exec('make', [`${target}`, `${customOption}`], options); } else { yield exec.exec('make', [`${target}`], options); } +<<<<<<< HEAD ======= yield exec.exec('make', [`${target} ${customOption}`], options); >>>>>>> 79a6303 (support custom_target) +======= +>>>>>>> 43100af (support custom_target) } catch (error) { core.setFailed(error.message); diff --git a/src/runaqa.ts b/src/runaqa.ts index cd557d1..044d754 100644 --- a/src/runaqa.ts +++ b/src/runaqa.ts @@ -43,11 +43,14 @@ export async function runaqaTest( customTarget: string ): Promise { await installDependency() +<<<<<<< HEAD let customOption = '' if (target.includes('custom') && customTarget !== '') { customOption = `${target.toUpperCase()}_TARGET=${customTarget}` } >>>>>>> 79a6303 (support custom_target) +======= +>>>>>>> 43100af (support custom_target) process.env.BUILD_LIST = buildList if (!('TEST_JDK_HOME' in process.env)) process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource) @@ -99,18 +102,26 @@ export async function runaqaTest( process.chdir('TKG') try { await exec.exec('make compile') +<<<<<<< HEAD <<<<<<< HEAD if (target.includes('custom') && customTarget !== '') { const customOption = `${target .substr(1) .toUpperCase()}_TARGET=${customTarget}` +======= + if (target.includes('custom') && customTarget !== '') { + const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}` +>>>>>>> 43100af (support custom_target) await exec.exec('make', [`${target}`, `${customOption}`], options) } else { await exec.exec('make', [`${target}`], options) } +<<<<<<< HEAD ======= await exec.exec('make', [`${target} ${customOption}`], options) >>>>>>> 79a6303 (support custom_target) +======= +>>>>>>> 43100af (support custom_target) } catch (error) { core.setFailed(error.message) }