1
0
Fork 0

Create xar during test instead of using prebuilt

pull/207/head
Frederik Wallner 2020-05-03 21:01:30 +02:00
parent ac3a3233fa
commit 90558e58b3
No known key found for this signature in database
GPG Key ID: AB5A2354F2F8FDC3
6 changed files with 11 additions and 5 deletions

View File

@ -0,0 +1 @@
file-with-ç-character.txt

View File

@ -0,0 +1 @@
file.txt contents

View File

@ -0,0 +1 @@
folder/nested-file.txt contents

View File

@ -350,15 +350,18 @@ describe('@actions/tool-cache', function() {
} else if (IS_MAC) {
it('extract .xar', async () => {
const tempDir = path.join(tempPath, 'test-install.xar')
const sourcePath = path.join(__dirname, 'data', 'archive-content')
const targetPath = path.join(tempDir, 'test.xar')
await io.mkdirP(tempDir)
// copy the .xar file to the test dir
const _xarFile: string = path.join(tempDir, 'test.xar')
await io.cp(path.join(__dirname, 'data', 'test.xar'), _xarFile)
// Create test archive
const xarPath = await io.which('xar', true)
await exec.exec(`${xarPath}`, ['-cf', targetPath, '.'], {
cwd: sourcePath
})
// extract/cache
const extPath: string = await tc.extractXar(_xarFile, undefined, '-x')
const extPath: string = await tc.extractXar(targetPath, undefined, '-x')
await tc.cacheDir(extPath, 'my-xar-contents', '1.1.0')
const toolPath: string = tc.find('my-xar-contents', '1.1.0')