diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cc6351..c9f93c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,3 +30,23 @@ jobs: uses: ./ with: version: v23.0.0 + + channel: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up Docker + uses: ./ + with: + version: v23.0.0-rc.4 + channel: test diff --git a/README.md b/README.md index b57c238..5a0d3dd 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,10 @@ jobs: Following inputs can be used as `step.with` keys -| Name | Type | Default | Description | -|-----------|--------|----------|--------------------------------------| -| `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). | +| Name | Type | Default | Description | +|-----------|--------|----------|---------------------------------------------------------------------------------------------------| +| `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). | +| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). | ## Contributing diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 0d5f15d..eeefcdd 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -21,6 +21,18 @@ describe('getInputs', () => { ]), { version: 'v23.0.1', + channel: '', + } as context.Inputs + ], + [ + 1, + new Map([ + ['version', 'v23.0.0-rc.4'], + ['channel', 'test'], + ]), + { + version: 'v23.0.0-rc.4', + channel: 'test', } as context.Inputs ] ])( diff --git a/action.yml b/action.yml index 2bb5ec8..ec77798 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,9 @@ inputs: version: description: 'Docker CE version. (e.g, v23.0.1)' required: false + channel: + description: 'Docker CE channel. (e.g, stable, edge or test)' + required: false runs: using: 'node16' diff --git a/src/context.ts b/src/context.ts index fa1287d..2baf83c 100644 --- a/src/context.ts +++ b/src/context.ts @@ -2,10 +2,12 @@ import * as core from '@actions/core'; export interface Inputs { version: string; + channel: string; } export function getInputs(): Inputs { return { - version: core.getInput('version') + version: core.getInput('version'), + channel: core.getInput('channel') }; } diff --git a/src/main.ts b/src/main.ts index 792b60f..033f45a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,7 +17,8 @@ actionsToolkit.run( const install = new Install({ runDir: runDir, - version: input.version + version: input.version, + channel: input.channel }); let toolDir; if (!(await Docker.isAvailable()) || input.version) {