mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-03-31 20:17:48 +02:00
Merge branch 'main' into check
This commit is contained in:
commit
04984d790b
8 changed files with 38 additions and 50 deletions
2
.licenses/npm/@actions/cache.dep.yml
generated
2
.licenses/npm/@actions/cache.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/cache"
|
||||
version: 3.1.3
|
||||
version: 3.1.4
|
||||
type: npm
|
||||
summary:
|
||||
homepage:
|
||||
|
|
|
@ -31,6 +31,7 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
|
|||
* New actions are available for granular control over caches - [restore](restore/action.yml) and [save](save/action.yml).
|
||||
* Support cross-os caching as an opt-in feature. See [Cross OS caching](./tips-and-workarounds.md#cross-os-cache) for more info.
|
||||
* Added option to fail job on cache miss. See [Exit workflow on cache miss](./restore/README.md#exit-workflow-on-cache-miss) for more info.
|
||||
* Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners
|
||||
* Added new [check](check/action.yml) action to check if a check entry exists without downloading it.
|
||||
|
||||
See the [v2 README.md](https://github.com/actions/cache/blob/v2/README.md) for older updates.
|
||||
|
|
|
@ -74,5 +74,8 @@
|
|||
### 3.2.5
|
||||
- Added fix to prevent from setting MYSYS environment variable globally.
|
||||
|
||||
### 3.2.6
|
||||
- Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners.
|
||||
|
||||
### 3.3.0
|
||||
- Added new [check](check/action.yml) action to check if a check entry exists without downloading it.
|
||||
|
|
20
dist/restore-only/index.js
vendored
20
dist/restore-only/index.js
vendored
|
@ -1152,12 +1152,13 @@ function unlinkFile(filePath) {
|
|||
});
|
||||
}
|
||||
exports.unlinkFile = unlinkFile;
|
||||
function getVersion(app) {
|
||||
function getVersion(app, additionalArgs = []) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Checking ${app} --version`);
|
||||
let versionOutput = '';
|
||||
additionalArgs.push('--version');
|
||||
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
||||
try {
|
||||
yield exec.exec(`${app} --version`, [], {
|
||||
yield exec.exec(`${app}`, additionalArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
listeners: {
|
||||
|
@ -1177,19 +1178,14 @@ function getVersion(app) {
|
|||
// Use zstandard if possible to maximize cache performance
|
||||
function getCompressionMethod() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const versionOutput = yield getVersion('zstd');
|
||||
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
||||
const version = semver.clean(versionOutput);
|
||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
||||
// zstd is not installed
|
||||
core.debug(`zstd version: ${version}`);
|
||||
if (versionOutput === '') {
|
||||
return constants_1.CompressionMethod.Gzip;
|
||||
}
|
||||
else if (!version || semver.lt(version, 'v1.3.2')) {
|
||||
// zstd is installed but using a version earlier than v1.3.2
|
||||
// v1.3.2 is required to use the `--long` options in zstd
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
else {
|
||||
return constants_1.CompressionMethod.Zstd;
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
20
dist/restore/index.js
vendored
20
dist/restore/index.js
vendored
|
@ -1152,12 +1152,13 @@ function unlinkFile(filePath) {
|
|||
});
|
||||
}
|
||||
exports.unlinkFile = unlinkFile;
|
||||
function getVersion(app) {
|
||||
function getVersion(app, additionalArgs = []) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Checking ${app} --version`);
|
||||
let versionOutput = '';
|
||||
additionalArgs.push('--version');
|
||||
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
||||
try {
|
||||
yield exec.exec(`${app} --version`, [], {
|
||||
yield exec.exec(`${app}`, additionalArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
listeners: {
|
||||
|
@ -1177,19 +1178,14 @@ function getVersion(app) {
|
|||
// Use zstandard if possible to maximize cache performance
|
||||
function getCompressionMethod() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const versionOutput = yield getVersion('zstd');
|
||||
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
||||
const version = semver.clean(versionOutput);
|
||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
||||
// zstd is not installed
|
||||
core.debug(`zstd version: ${version}`);
|
||||
if (versionOutput === '') {
|
||||
return constants_1.CompressionMethod.Gzip;
|
||||
}
|
||||
else if (!version || semver.lt(version, 'v1.3.2')) {
|
||||
// zstd is installed but using a version earlier than v1.3.2
|
||||
// v1.3.2 is required to use the `--long` options in zstd
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
else {
|
||||
return constants_1.CompressionMethod.Zstd;
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
20
dist/save-only/index.js
vendored
20
dist/save-only/index.js
vendored
|
@ -1208,12 +1208,13 @@ function unlinkFile(filePath) {
|
|||
});
|
||||
}
|
||||
exports.unlinkFile = unlinkFile;
|
||||
function getVersion(app) {
|
||||
function getVersion(app, additionalArgs = []) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Checking ${app} --version`);
|
||||
let versionOutput = '';
|
||||
additionalArgs.push('--version');
|
||||
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
||||
try {
|
||||
yield exec.exec(`${app} --version`, [], {
|
||||
yield exec.exec(`${app}`, additionalArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
listeners: {
|
||||
|
@ -1233,19 +1234,14 @@ function getVersion(app) {
|
|||
// Use zstandard if possible to maximize cache performance
|
||||
function getCompressionMethod() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const versionOutput = yield getVersion('zstd');
|
||||
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
||||
const version = semver.clean(versionOutput);
|
||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
||||
// zstd is not installed
|
||||
core.debug(`zstd version: ${version}`);
|
||||
if (versionOutput === '') {
|
||||
return constants_1.CompressionMethod.Gzip;
|
||||
}
|
||||
else if (!version || semver.lt(version, 'v1.3.2')) {
|
||||
// zstd is installed but using a version earlier than v1.3.2
|
||||
// v1.3.2 is required to use the `--long` options in zstd
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
else {
|
||||
return constants_1.CompressionMethod.Zstd;
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
20
dist/save/index.js
vendored
20
dist/save/index.js
vendored
|
@ -1152,12 +1152,13 @@ function unlinkFile(filePath) {
|
|||
});
|
||||
}
|
||||
exports.unlinkFile = unlinkFile;
|
||||
function getVersion(app) {
|
||||
function getVersion(app, additionalArgs = []) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Checking ${app} --version`);
|
||||
let versionOutput = '';
|
||||
additionalArgs.push('--version');
|
||||
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
||||
try {
|
||||
yield exec.exec(`${app} --version`, [], {
|
||||
yield exec.exec(`${app}`, additionalArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
listeners: {
|
||||
|
@ -1177,19 +1178,14 @@ function getVersion(app) {
|
|||
// Use zstandard if possible to maximize cache performance
|
||||
function getCompressionMethod() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const versionOutput = yield getVersion('zstd');
|
||||
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
||||
const version = semver.clean(versionOutput);
|
||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
||||
// zstd is not installed
|
||||
core.debug(`zstd version: ${version}`);
|
||||
if (versionOutput === '') {
|
||||
return constants_1.CompressionMethod.Gzip;
|
||||
}
|
||||
else if (!version || semver.lt(version, 'v1.3.2')) {
|
||||
// zstd is installed but using a version earlier than v1.3.2
|
||||
// v1.3.2 is required to use the `--long` options in zstd
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
else {
|
||||
return constants_1.CompressionMethod.Zstd;
|
||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ jobs:
|
|||
gh extension install actions/gh-actions-cache
|
||||
|
||||
REPO=${{ github.repository }}
|
||||
BRANCH=${{ github.ref }}
|
||||
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
|
||||
echo "Fetching list of cache key"
|
||||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
|
||||
|
|
Loading…
Add table
Reference in a new issue