rename: local-cache-path -> cache-image-path

This commit is contained in:
문성하 2025-02-02 22:13:36 +09:00
parent 28a18910d7
commit 02897d02f5
No known key found for this signature in database
7 changed files with 16 additions and 17 deletions

View File

@ -26,9 +26,8 @@ jobs:
strategy:
fail-fast: false
matrix:
local-cache-path:
cache-image-path:
- /tmp/cache
# - ''
steps:
-
@ -39,7 +38,7 @@ jobs:
id: qemu
uses: ./
with:
local-cache-path: ${{ matrix.local-cache-path }}
cache-image-path: ${{ matrix.cache-image-path }}
-
name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}

View File

@ -23,7 +23,7 @@ describe('getInputs', () => {
image: 'docker.io/tonistiigi/binfmt:latest',
platforms: 'all',
cacheImage: true,
localCachePath: ''
cacheImagePath: ''
} as context.Inputs
],
[
@ -37,7 +37,7 @@ describe('getInputs', () => {
image: 'docker/binfmt:latest',
platforms: 'arm64,riscv64,arm',
cacheImage: false,
localCachePath: ''
cacheImagePath: ''
} as context.Inputs
],
[
@ -50,7 +50,7 @@ describe('getInputs', () => {
image: 'docker.io/tonistiigi/binfmt:latest',
platforms: 'arm64,riscv64,arm',
cacheImage: true,
localCachePath: ''
cacheImagePath: ''
} as context.Inputs
],
[
@ -58,13 +58,13 @@ describe('getInputs', () => {
new Map<string, string>([
['platforms', 'arm64'],
['cache-image', 'false'],
['local-cache-path', '/tmp/cache'],
['cache-image-path', '/tmp/cache'],
]),
{
image: 'docker.io/tonistiigi/binfmt:latest',
platforms: 'arm64',
cacheImage: false,
localCachePath: '/tmp/cache'
cacheImagePath: '/tmp/cache'
} as context.Inputs
]
])(

View File

@ -19,7 +19,7 @@ inputs:
description: 'Cache binfmt image to GitHub Actions cache backend'
default: 'true'
required: false
local-cache-path:
cache-image-path:
description: >
Local path to store the binfmt image. Using this enables local caching instead of GitHub Actions cache.
Note: The "latest" tag won't auto-update - delete the cached file to fetch updates.

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ export interface Inputs {
image: string;
platforms: string;
cacheImage: boolean;
localCachePath: string;
cacheImagePath: string;
}
export function getInputs(): Inputs {
@ -13,6 +13,6 @@ export function getInputs(): Inputs {
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
platforms: Util.getInputList('platforms').join(',') || 'all',
cacheImage: core.getBooleanInput('cache-image'),
localCachePath: core.getInput('local-cache-path') || ''
cacheImagePath: core.getInput('cache-image-path') || ''
};
}

View File

@ -20,9 +20,9 @@ actionsToolkit.run(
await Docker.printInfo();
});
if (input.localCachePath !== '') {
if (input.cacheImagePath !== '') {
await core.group(`Pulling binfmt Docker image with local cache`, async () => {
await loadDockerImageFromCache(input.localCachePath, input.image);
await loadDockerImageFromCache(input.cacheImagePath, input.image);
});
} else {
await core.group(`Pulling binfmt Docker image`, async () => {
@ -68,9 +68,9 @@ actionsToolkit.run(
// post
async () => {
const input: context.Inputs = context.getInputs();
if (input.localCachePath !== '') {
if (input.cacheImagePath !== '') {
await core.group(`Saving binfmt Docker image`, async () => {
await saveDockerImageToCache(input.localCachePath, input.image);
await saveDockerImageToCache(input.cacheImagePath, input.image);
});
}
}