mirror of
https://github.com/docker/setup-qemu-action.git
synced 2025-04-03 04:40:10 +08:00
rename: cache image path -> cache image dir
This commit is contained in:
parent
32312577ce
commit
87544e7f56
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
cache-image-path:
|
||||
cache-image-dir:
|
||||
- /tmp/cache
|
||||
|
||||
steps:
|
||||
@ -38,7 +38,7 @@ jobs:
|
||||
id: qemu
|
||||
uses: ./
|
||||
with:
|
||||
cache-image-path: ${{ matrix.cache-image-path }}
|
||||
cache-image-dir: ${{ matrix.cache-image-dir }}
|
||||
-
|
||||
name: Available platforms
|
||||
run: echo ${{ steps.qemu.outputs.platforms }}
|
||||
|
12
README.md
12
README.md
@ -42,12 +42,12 @@ jobs:
|
||||
|
||||
The following inputs can be used as `step.with` keys:
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|---------------|--------|-------------------------------------------------------------------------------|----------------------------------------------------|
|
||||
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
||||
| `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) |
|
||||
| `cache-image` | Bool | `true` | Cache binfmt image to GitHub Actions cache backend |
|
||||
| `cache-image-path` | String | ` ` | 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. |
|
||||
| Name | Type | Default | Description |
|
||||
|--------------------|--------|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
||||
| `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) |
|
||||
| `cache-image` | Bool | `true` | Cache binfmt image to GitHub Actions cache backend |
|
||||
| `cache-image-dir` | String | ` ` | 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. |
|
||||
|
||||
### outputs
|
||||
|
||||
|
@ -23,7 +23,7 @@ describe('getInputs', () => {
|
||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: 'all',
|
||||
cacheImage: true,
|
||||
cacheImagePath: ''
|
||||
cacheImageDir: ''
|
||||
} as context.Inputs
|
||||
],
|
||||
[
|
||||
@ -37,7 +37,7 @@ describe('getInputs', () => {
|
||||
image: 'docker/binfmt:latest',
|
||||
platforms: 'arm64,riscv64,arm',
|
||||
cacheImage: false,
|
||||
cacheImagePath: ''
|
||||
cacheImageDir: ''
|
||||
} as context.Inputs
|
||||
],
|
||||
[
|
||||
@ -50,7 +50,7 @@ describe('getInputs', () => {
|
||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: 'arm64,riscv64,arm',
|
||||
cacheImage: true,
|
||||
cacheImagePath: ''
|
||||
cacheImageDir: ''
|
||||
} as context.Inputs
|
||||
],
|
||||
[
|
||||
@ -58,13 +58,13 @@ describe('getInputs', () => {
|
||||
new Map<string, string>([
|
||||
['platforms', 'arm64'],
|
||||
['cache-image', 'false'],
|
||||
['cache-image-path', '/tmp/cache'],
|
||||
['cache-image-dir', '/tmp/cache'],
|
||||
]),
|
||||
{
|
||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: 'arm64',
|
||||
cacheImage: false,
|
||||
cacheImagePath: '/tmp/cache'
|
||||
cacheImageDir: '/tmp/cache'
|
||||
} as context.Inputs
|
||||
]
|
||||
])(
|
||||
|
@ -19,7 +19,7 @@ inputs:
|
||||
description: 'Cache binfmt image to GitHub Actions cache backend'
|
||||
default: 'true'
|
||||
required: false
|
||||
cache-image-path:
|
||||
cache-image-dir:
|
||||
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.
|
||||
|
16
dist/index.js
generated
vendored
16
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
12
dist/licenses.txt
generated
vendored
12
dist/licenses.txt
generated
vendored
@ -196,9 +196,9 @@ SOFTWARE.
|
||||
|
||||
@azure/core-http-compat
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Copyright (c) 2020 Microsoft
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -210,7 +210,7 @@ furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
@ -246,9 +246,9 @@ SOFTWARE.
|
||||
|
||||
@azure/core-rest-pipeline
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Copyright (c) 2020 Microsoft
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -260,7 +260,7 @@ furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
|
7982
package-lock.json
generated
Normal file
7982
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@ export interface Inputs {
|
||||
image: string;
|
||||
platforms: string;
|
||||
cacheImage: boolean;
|
||||
cacheImagePath: string;
|
||||
cacheImageDir: 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'),
|
||||
cacheImagePath: core.getInput('cache-image-path') || ''
|
||||
cacheImageDir: core.getInput('cache-image-dir') || ''
|
||||
};
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ actionsToolkit.run(
|
||||
await Docker.printInfo();
|
||||
});
|
||||
|
||||
if (input.cacheImagePath !== '') {
|
||||
if (input.cacheImageDir !== '') {
|
||||
await core.group(`Pulling binfmt Docker image with local cache`, async () => {
|
||||
await loadDockerImageFromCache(input.cacheImagePath, input.image);
|
||||
await loadDockerImageFromCache(input.cacheImageDir, 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.cacheImagePath !== '') {
|
||||
if (input.cacheImageDir !== '') {
|
||||
await core.group(`Saving binfmt Docker image`, async () => {
|
||||
await saveDockerImageToCache(input.cacheImagePath, input.image);
|
||||
await saveDockerImageToCache(input.cacheImageDir, input.image);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user