mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Hint enabling cache if not already enabled.
This commit is contained in:
parent
37d5ce498f
commit
fe2311ef4b
File diff suppressed because one or more lines are too long
@ -1,9 +1,10 @@
|
||||
import { Action, Docker, Input, ImageTag, BuildParameters } from './model';
|
||||
import { Action, BuildParameters, Cache, Docker, Input, ImageTag } from './model';
|
||||
|
||||
const core = require('@actions/core');
|
||||
|
||||
async function action() {
|
||||
Action.checkCompatibility();
|
||||
Cache.verify();
|
||||
|
||||
const { dockerfile, workspace, builderFolder } = Action;
|
||||
const buildParameters = BuildParameters.create(Input.getFromUser());
|
||||
|
23
src/model/cache.js
Normal file
23
src/model/cache.js
Normal file
@ -0,0 +1,23 @@
|
||||
import fs from 'fs';
|
||||
import Action from './action';
|
||||
import Project from './project';
|
||||
|
||||
class Cache {
|
||||
static verify() {
|
||||
if (!fs.existsSync(Project.libraryFolder)) {
|
||||
this.notifyAboutCachingPossibility();
|
||||
}
|
||||
}
|
||||
|
||||
static notifyAboutCachingPossibility() {
|
||||
if (Action.isRunningLocally) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Library folder does not exist.');
|
||||
console.log('Consider setting up caching to speed up your workflow.');
|
||||
console.log('If this is not your first build.');
|
||||
}
|
||||
}
|
||||
|
||||
export default Cache;
|
9
src/model/cache.test.js
Normal file
9
src/model/cache.test.js
Normal file
@ -0,0 +1,9 @@
|
||||
import Cache from './cache';
|
||||
|
||||
describe('Cache', () => {
|
||||
describe('Verification', () => {
|
||||
it('does not throw', () => {
|
||||
expect(() => Cache.verify()).not.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
@ -1,8 +1,9 @@
|
||||
import Action from './action';
|
||||
import BuildParameters from './build-parameters';
|
||||
import Cache from './cache';
|
||||
import Docker from './docker';
|
||||
import Input from './input';
|
||||
import ImageTag from './image-tag';
|
||||
import Platform from './platform';
|
||||
|
||||
export { Action, BuildParameters, Docker, Input, ImageTag, Platform };
|
||||
export { Action, BuildParameters, Cache, Docker, Input, ImageTag, Platform };
|
||||
|
Loading…
Reference in New Issue
Block a user