Try more verbosity to see what's really happening

pull/26/head
Webber 2020-01-25 23:53:34 +01:00
parent faff46aead
commit f6fc5c14a8
2 changed files with 17 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,13 +2,14 @@ import Input from './input';
import Unity from './unity'; import Unity from './unity';
const tc = require('@actions/tool-cache'); const tc = require('@actions/tool-cache');
const exec = require('@actions/exec');
const core = require('@actions/core'); const core = require('@actions/core');
class Cache { class Cache {
static get libraryKey() { static get libraryKey() {
const { projectPath } = Input.getFromUser(); const { projectPath, targetPlatform } = Input.getFromUser();
return `alwaysthesame`; return `${projectPath}-${targetPlatform}`;
} }
static async load() { static async load() {
@ -17,15 +18,27 @@ class Cache {
// Cache miss // Cache miss
if (!libraryFolder) { if (!libraryFolder) {
console.log(`Cache was not available for "${this.libraryKey}"`);
return; return;
} }
// Restore // Restore
console.log(`Restoring cache "${libraryFolder}"`);
await core.addPath(libraryFolder); await core.addPath(libraryFolder);
console.log(`contents of ${libraryFolder}`);
await exec.exec(`ls -alh ${libraryFolder}`);
} }
static async save() { static async save() {
await tc.cacheDir(Unity.libraryFolder, 'library', this.libraryKey); const cachedPath = await tc.cacheDir(Unity.libraryFolder, 'library', this.libraryKey);
console.log(`cached ${cachedPath}`);
console.log(`Contents of ${Unity.libraryFolder}:`);
await exec.exec(`ls -alh ${Unity.libraryFolder}`);
console.log(`contents of ${cachedPath}`);
await exec.exec(`ls -alh ${cachedPath}`);
} }
} }