mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
Add functionality to setup maven binary
Add functionality to setup maven in order to use for project building
This commit is contained in:
parent
104660f1cc
commit
c45a722262
10 changed files with 150 additions and 60 deletions
|
@ -156,4 +156,32 @@ describe('installer tests', () => {
|
|||
expect(thrown).toBe(true);
|
||||
return;
|
||||
});
|
||||
|
||||
it('wrong maven version of Maven has to throw error', async () => {
|
||||
let thrown = false;
|
||||
try {
|
||||
await installer.getMaven('2-3-4');
|
||||
} catch (e) {
|
||||
thrown = true;
|
||||
}
|
||||
expect(thrown).toBe(true);
|
||||
});
|
||||
|
||||
it('Installs version of Maven and stores it to cache', async () => {
|
||||
await installer.getMaven('3.6.3');
|
||||
const mvnDir = path.join(toolDir, 'mvn', '3.6.3', 'x64');
|
||||
|
||||
expect(fs.existsSync(`${mvnDir}.complete`)).toBe(true);
|
||||
expect(fs.existsSync(path.join(mvnDir))).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('Uses version of Maven installed in cache', async () => {
|
||||
const mvnDir: string = path.join(toolDir, 'mvn', '3.6.3', 'x64');
|
||||
console.log(mvnDir);
|
||||
await io.mkdirP(mvnDir);
|
||||
fs.writeFileSync(`${mvnDir}.complete`, 'hello');
|
||||
// This will throw if it doesn't find it in the cache (because no such version exists)
|
||||
await installer.getMaven('3.6.3');
|
||||
return;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue