Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
}
includes.push({ os: os, test: test, test_name: 'root', docker_install_type: 'archive', docker_install_version: 'v26.1.4' });
includes.push({ os: os, test: test, test_name: 'root', docker_install_type: 'archive', docker_install_version: 'latest' });
includes.push({ os: os, test: test, test_name: 'root', docker_install_type: 'archive', docker_install_version: 'v29.0.0-rc.1', docker_install_channel: 'test' });
if (os === 'ubuntu-latest') {
includes.push({ os: os, test: test, test_name: 'rootless', docker_install_type: 'image', docker_install_version: 'latest' });
includes.push({ os: os, test: test, test_name: 'rootless', docker_install_type: 'archive', docker_install_version: 'latest' });
Expand Down Expand Up @@ -208,6 +209,7 @@ jobs:
TEST_FOR_SUMMARY: ${{ secrets.TEST_FOR_SUMMARY }}
DOCKER_INSTALL_TYPE: ${{ matrix.docker_install_type }}
DOCKER_INSTALL_VERSION: ${{ matrix.docker_install_version }}
DOCKER_INSTALL_CHANNEL: ${{ matrix.docker_install_channel }}
-
name: Check coverage
run: |
Expand Down
6 changes: 4 additions & 2 deletions __tests__/docker/install.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ async function ensureNoSystemContainerd() {
function getSources(root: boolean): Array<InstallSource> {
const dockerInstallType = process.env.DOCKER_INSTALL_TYPE;
const dockerInstallVersion = process.env.DOCKER_INSTALL_VERSION;
const dockerInstallChannel = process.env.DOCKER_INSTALL_CHANNEL || 'stable';
if (dockerInstallType && dockerInstallVersion) {
if (dockerInstallType === 'archive') {
// prettier-ignore
return [
{ type: dockerInstallType, version: dockerInstallVersion, channel: 'stable'} as InstallSourceArchive
{ type: dockerInstallType, version: dockerInstallVersion, channel: dockerInstallChannel} as InstallSourceArchive
];
} else {
// prettier-ignore
Expand All @@ -173,7 +174,8 @@ function getSources(root: boolean): Array<InstallSource> {
{type: 'image', tag: 'master'} as InstallSourceImage,
{type: 'image', tag: 'latest'} as InstallSourceImage,
{type: 'archive', version: 'v26.1.4', channel: 'stable'} as InstallSourceArchive,
{type: 'archive', version: 'latest', channel: 'stable'} as InstallSourceArchive
{type: 'archive', version: 'latest', channel: 'stable'} as InstallSourceArchive,
{type: 'archive', version: 'v29.0.0-rc.1', channel: 'test'} as InstallSourceArchive
];
} else {
// prettier-ignore
Expand Down
11 changes: 10 additions & 1 deletion __tests__/docker/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('download', () => {
[archive('v20.10.22', 'stable'), 'linux'],
[archive('v20.10.22', 'stable'), 'darwin'],
[archive('v20.10.22', 'stable'), 'win32'],
[archive('v29.0.0-rc.1', 'test'), 'linux'],

[image('master'), 'linux'],
[image('master'), 'win32'],
Expand Down Expand Up @@ -81,14 +82,22 @@ describe('getRelease', () => {
expect(release?.tag_name).not.toEqual('');
});

it('returns v23.0.0 buildx GitHub release', async () => {
it('returns v23.0.0 docker GitHub release', async () => {
const release = await Install.getRelease('v23.0.0');
expect(release).not.toBeNull();
expect(release?.id).toEqual(91109643);
expect(release?.tag_name).toEqual('v23.0.0');
expect(release?.html_url).toEqual('https://github.com/moby/moby/releases/tag/v23.0.0');
});

it('returns v29.0.0-rc.1 docker GitHub release', async () => {
const release = await Install.getRelease('v29.0.0-rc.1');
expect(release).not.toBeNull();
expect(release?.id).toEqual(252020476);
expect(release?.tag_name).toEqual('docker-v29.0.0-rc.1');
expect(release?.html_url).toEqual('https://github.com/moby/moby/releases/tag/docker-v29.0.0-rc.1');
});

it('unknown release', async () => {
await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
});
Expand Down
2 changes: 1 addition & 1 deletion src/docker/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class Install {

private async downloadSourceArchive(component: 'docker' | 'docker-rootless-extras', src: InstallSourceArchive): Promise<string> {
const release: GitHubRelease = await Install.getRelease(src.version);
this._version = release.tag_name.replace(/^v+|v+$/g, '');
this._version = release.tag_name.replace(/^(docker-)?v+/, '');
core.debug(`docker.Install.downloadSourceArchive version: ${this._version}`);

const downloadURL = this.downloadURL(component, this._version, src.channel);
Expand Down
Loading