Skip to content

Commit

Permalink
Merge branch 'v2-working-branch' into v2-build-push
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
CrazyMax committed Aug 16, 2020
2 parents 1ae53ef + 068cb8e commit fbd34ed
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 3,861 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/setup-buildx-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ jobs:
- v0.2.2
- ""
steps:
-
name: Runner info
run: |
sudo apt-get install -y hwinfo
sudo hwinfo --short
sudo mount
-
name: Checkout
uses: actions/checkout@v2.3.1
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/setup-buildx-precheckin.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/setup-qemu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ jobs:
- all
- arm64,riscv64,arm
steps:
-
name: Runner info
run: |
sudo apt-get install -y hwinfo
sudo hwinfo --short
sudo mount
-
name: Checkout
uses: actions/checkout@v2.3.1
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/setup-qemu-precheckin.yml

This file was deleted.

21 changes: 11 additions & 10 deletions setup-buildx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
-
name: Set up Docker Buildx
id: buildx
uses: docker/actions/setup-buildx@v1
uses: docker/setup-buildx-action@v1
with:
version: latest
-
Expand Down Expand Up @@ -71,13 +71,13 @@ jobs:
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/actions/setup-qemu@v1
uses: docker/setup-qemu-action@v1
with:
platforms: all
-
name: Set up Docker Buildx
id: buildx
uses: docker/actions/setup-buildx@v1
uses: docker/setup-buildx-action@v1
with:
version: latest
-
Expand All @@ -91,13 +91,14 @@ jobs:
Following inputs can be used as `step.with` keys

| Name | Type | Default | Description |
|------------------|---------|-----------------------------------|------------------------------------|
| `version` | String | _the one installed on the runner_ | [Buildx](https://github.com/docker/buildx) version. e.g. `v0.3.0`, `latest` |
| `driver` | String | `docker-container` | Sets the [builder driver](https://github.com/docker/buildx#--driver-driver) to be used. |
| `driver-opt` | String | | Passes additional [driver-specific options](https://github.com/docker/buildx#--driver-opt-options). e.g. `image=moby/buildkit:master` |
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
| `use` | Bool | `true` | Switch to this builder instance |
| Name | Type | Default | Description |
|--------------------|---------|-----------------------------------|------------------------------------|
| `version` | String | _the one installed on the runner_ | [Buildx](https://github.com/docker/buildx) version. e.g. `v0.3.0`, `latest` |
| `driver` | String | `docker-container` | Sets the [builder driver](https://github.com/docker/buildx#--driver-driver) to be used. |
| `driver-opt` | String | | Passes additional [driver-specific options](https://github.com/docker/buildx#--driver-opt-options). e.g. `image=moby/buildkit:master` |
| `buildkitd-flags` | String | | [Flags for buildkitd](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) daemon. |
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
| `use` | Bool | `true` | Switch to this builder instance |

### outputs

Expand Down
6 changes: 3 additions & 3 deletions setup-buildx/__tests__/buildx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
describe('buildx', () => {
it('is available', async () => {
expect(await buildx.isAvailable()).toBe(true);
});
}, 100000);

it('count builders', async () => {
const countBuilders = await buildx.countBuilders();
console.log(`countBuilders: ${countBuilders}`);
expect(countBuilders).toBeGreaterThan(0);
});
}, 100000);

it('platforms', async () => {
const platforms = await buildx.platforms();
console.log(`platforms: ${platforms}`);
expect(platforms).not.toBeUndefined();
expect(platforms).not.toEqual('');
});
}, 100000);

it('acquires v0.2.2 version of buildx', async () => {
const buildxBin = await buildx.install('v0.2.2', tmpDir);
Expand Down
11 changes: 7 additions & 4 deletions setup-buildx/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'Docker - Setup Buildx'
description: 'GitHub Action to set up Docker Buildx'
author: 'crazy-max'
name: 'Docker Setup Buildx'
description: 'Set up Docker Buildx'
author: 'docker'
branding:
icon: 'anchor'
color: 'blue'
icon: 'truck'

inputs:
version:
Expand All @@ -17,6 +17,9 @@ inputs:
driver-opt:
description: 'Passes additional driver-specific options. Eg. image=moby/buildkit:master'
required: false
buildkitd-flags:
description: 'Flags for buildkitd daemon'
required: false
install:
description: 'Sets up docker build command as an alias to docker buildx'
default: 'false'
Expand Down
36 changes: 21 additions & 15 deletions setup-buildx/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions setup-buildx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-buildx",
"description": "GitHub Action to set up Docker Buildx",
"description": "Set up Docker Buildx",
"main": "lib/main.js",
"scripts": {
"build": "tsc && ncc build",
Expand All @@ -11,15 +11,17 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/docker/actions.git",
"directory": "setup-buildx"
"url": "git+https://github.com/docker/setup-buildx-action.git"
},
"keywords": [
"actions",
"docker",
"buildx"
],
"author": "CrazyMax",
"author": "Docker",
"contributors": [
"CrazyMax"
],
"license": "Apache-2.0",
"dependencies": {
"@actions/core": "^1.2.4",
Expand Down
4 changes: 2 additions & 2 deletions setup-buildx/src/exec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as actionsExec from '@actions/exec';
import * as aexec from '@actions/exec';
import {ExecOptions} from '@actions/exec';

export interface ExecResult {
Expand All @@ -24,7 +24,7 @@ export const exec = async (command: string, args: string[] = [], silent: boolean
}
};

const returnCode: number = await actionsExec.exec(command, args, options);
const returnCode: number = await aexec.exec(command, args, options);

return {
success: returnCode === 0,
Expand Down
Loading

0 comments on commit fbd34ed

Please sign in to comment.