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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
cache-image-path:
|
cache-image-dir:
|
||||||
- /tmp/cache
|
- /tmp/cache
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
id: qemu
|
id: qemu
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
cache-image-path: ${{ matrix.cache-image-path }}
|
cache-image-dir: ${{ matrix.cache-image-dir }}
|
||||||
-
|
-
|
||||||
name: Available platforms
|
name: Available platforms
|
||||||
run: echo ${{ steps.qemu.outputs.platforms }}
|
run: echo ${{ steps.qemu.outputs.platforms }}
|
||||||
|
@ -43,11 +43,11 @@ jobs:
|
|||||||
The following inputs can be used as `step.with` keys:
|
The following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|---------------|--------|-------------------------------------------------------------------------------|----------------------------------------------------|
|
|--------------------|--------|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
| `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`) |
|
| `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` | 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. |
|
| `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
|
### outputs
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ describe('getInputs', () => {
|
|||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'all',
|
platforms: 'all',
|
||||||
cacheImage: true,
|
cacheImage: true,
|
||||||
cacheImagePath: ''
|
cacheImageDir: ''
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -37,7 +37,7 @@ describe('getInputs', () => {
|
|||||||
image: 'docker/binfmt:latest',
|
image: 'docker/binfmt:latest',
|
||||||
platforms: 'arm64,riscv64,arm',
|
platforms: 'arm64,riscv64,arm',
|
||||||
cacheImage: false,
|
cacheImage: false,
|
||||||
cacheImagePath: ''
|
cacheImageDir: ''
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -50,7 +50,7 @@ describe('getInputs', () => {
|
|||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'arm64,riscv64,arm',
|
platforms: 'arm64,riscv64,arm',
|
||||||
cacheImage: true,
|
cacheImage: true,
|
||||||
cacheImagePath: ''
|
cacheImageDir: ''
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -58,13 +58,13 @@ describe('getInputs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['platforms', 'arm64'],
|
['platforms', 'arm64'],
|
||||||
['cache-image', 'false'],
|
['cache-image', 'false'],
|
||||||
['cache-image-path', '/tmp/cache'],
|
['cache-image-dir', '/tmp/cache'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'arm64',
|
platforms: 'arm64',
|
||||||
cacheImage: false,
|
cacheImage: false,
|
||||||
cacheImagePath: '/tmp/cache'
|
cacheImageDir: '/tmp/cache'
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
|
@ -19,7 +19,7 @@ inputs:
|
|||||||
description: 'Cache binfmt image to GitHub Actions cache backend'
|
description: 'Cache binfmt image to GitHub Actions cache backend'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
required: false
|
required: false
|
||||||
cache-image-path:
|
cache-image-dir:
|
||||||
description: >
|
description: >
|
||||||
Local path to store the binfmt image. Using this enables local caching instead of GitHub Actions cache.
|
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.
|
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
|
@azure/core-http-compat
|
||||||
MIT
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
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
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
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,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@ -246,9 +246,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
@azure/core-rest-pipeline
|
@azure/core-rest-pipeline
|
||||||
MIT
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
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
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
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,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
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;
|
image: string;
|
||||||
platforms: string;
|
platforms: string;
|
||||||
cacheImage: boolean;
|
cacheImage: boolean;
|
||||||
cacheImagePath: string;
|
cacheImageDir: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInputs(): Inputs {
|
export function getInputs(): Inputs {
|
||||||
@ -13,6 +13,6 @@ export function getInputs(): Inputs {
|
|||||||
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: Util.getInputList('platforms').join(',') || 'all',
|
platforms: Util.getInputList('platforms').join(',') || 'all',
|
||||||
cacheImage: core.getBooleanInput('cache-image'),
|
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();
|
await Docker.printInfo();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (input.cacheImagePath !== '') {
|
if (input.cacheImageDir !== '') {
|
||||||
await core.group(`Pulling binfmt Docker image with local cache`, async () => {
|
await core.group(`Pulling binfmt Docker image with local cache`, async () => {
|
||||||
await loadDockerImageFromCache(input.cacheImagePath, input.image);
|
await loadDockerImageFromCache(input.cacheImageDir, input.image);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await core.group(`Pulling binfmt Docker image`, async () => {
|
await core.group(`Pulling binfmt Docker image`, async () => {
|
||||||
@ -68,9 +68,9 @@ actionsToolkit.run(
|
|||||||
// post
|
// post
|
||||||
async () => {
|
async () => {
|
||||||
const input: context.Inputs = context.getInputs();
|
const input: context.Inputs = context.getInputs();
|
||||||
if (input.cacheImagePath !== '') {
|
if (input.cacheImageDir !== '') {
|
||||||
await core.group(`Saving binfmt Docker image`, async () => {
|
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