Skip to content

Commit

Permalink
remove 7z dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-guo committed Jan 20, 2025
1 parent aa7718e commit ba4cfe4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,13 @@ function installPlatformDependencies() {
else if (fs.existsSync('/usr/bin/yum')) {
// RPM Based
yield exec.exec('sudo yum update -y');
yield exec.exec('sudo yum install p7zip -y');
const antContribFile = yield tc.downloadTool(`https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download`);
yield tc.extractZip(`${antContribFile}`, `${tempDirectory}`);
yield io.cp(`${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, `${process.env.ANT_HOME}\\lib`);
}
else if (fs.existsSync('/sbin/apk')) {
// Alpine Based
yield exec.exec('apk update');
yield exec.exec('apk add p7zip');
const antContribFile = yield tc.downloadTool(`https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip/download`);
yield tc.extractZip(`${antContribFile}`, `${tempDirectory}`);
yield io.cp(`${tempDirectory}/ant-contrib/lib/ant-contrib.jar`, `${process.env.ANT_HOME}\\lib`);
Expand Down Expand Up @@ -561,12 +559,8 @@ function setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, t
}
// 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');
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
yield exec.exec(`${sevenzexe} e -y ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`);
yield exec.exec(`unzip -j ${dependents} -d ${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`);
if (buildList.includes('system')) {
if (aqasystemtestsRepo && aqasystemtestsRepo.length !== 0) {
getAqaSystemTestsRepo(aqasystemtestsRepo);
Expand Down
8 changes: 1 addition & 7 deletions src/runaqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ async function installPlatformDependencies(): Promise<void> {
} 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`
)
Expand All @@ -223,7 +222,6 @@ async function installPlatformDependencies(): Promise<void> {
} 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`
)
Expand Down Expand Up @@ -453,13 +451,9 @@ async function setupTestEnv(

// 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 -y ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`);
await exec.exec(`unzip -j ${dependents} -d ${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`);
if (buildList.includes('system')) {
if (aqasystemtestsRepo && aqasystemtestsRepo.length !== 0) {
getAqaSystemTestsRepo(aqasystemtestsRepo);
Expand Down

0 comments on commit ba4cfe4

Please sign in to comment.