mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
Move to cargo file.
This commit is contained in:
parent
81acac128f
commit
1df398a624
4 changed files with 67 additions and 69 deletions
26
post.ts
26
post.ts
|
@ -1,29 +1,5 @@
|
|||
import * as cache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import { CACHE_ENABLED, getPathsToCache, getPrimaryCacheKey } from './helpers';
|
||||
|
||||
async function saveCache() {
|
||||
if (!CACHE_ENABLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
const primaryKey = getPrimaryCacheKey();
|
||||
const cacheHitKey = core.getState('cache-hit-key');
|
||||
|
||||
if (cacheHitKey === primaryKey) {
|
||||
core.info(`Cache hit occured on the key ${cacheHitKey}, not saving cache`);
|
||||
return;
|
||||
}
|
||||
|
||||
core.info('Cleaning cache before saving');
|
||||
|
||||
await exec.exec('cargo', ['cache', '--autoclean']);
|
||||
|
||||
core.info(`Saving cache with key ${primaryKey}`);
|
||||
|
||||
await cache.saveCache(getPathsToCache(), primaryKey);
|
||||
}
|
||||
import { saveCache } from './src/cargo';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue