diff --git a/.github/docker-releases.json b/.github/docker-releases.json index 64d0d084..426aafa8 100644 --- a/.github/docker-releases.json +++ b/.github/docker-releases.json @@ -5,6 +5,12 @@ "html_url": "https://github.com/moby/moby/releases/tag/v27.3.1", "assets": [] }, + "v27.4.0-rc.1": { + "id": 185528936, + "tag_name": "v27.4.0-rc.1", + "html_url": "https://github.com/moby/moby/releases/tag/v27.4.0-rc.1", + "assets": [] + }, "v23.0.15": { "id": 178729348, "tag_name": "v23.0.15", diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a99d5601..6da276c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,10 +43,10 @@ jobs: shell: bash - name: Upload coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 if: env.RUN_CODECOV == 'true' with: - file: ./coverage/clover.xml + files: ./coverage/clover.xml flags: unit token: ${{ secrets.CODECOV_TOKEN }} @@ -98,7 +98,6 @@ jobs: - ubuntu-latest #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - macos-13 - - macos-12 - windows-latest steps: - @@ -163,9 +162,9 @@ jobs: shell: bash - name: Upload coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 if: env.RUN_CODECOV == 'true' with: - file: ./coverage/clover.xml + files: ./coverage/clover.xml flags: itg token: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/docker/install.ts b/src/docker/install.ts index 22828cfb..984fcf1b 100644 --- a/src/docker/install.ts +++ b/src/docker/install.ts @@ -279,9 +279,14 @@ export class Install { core.info(limaCfg); }); - const qemuArch = await Install.qemuArch(); + if (!(await Install.qemuInstalled())) { + await core.group('Installing QEMU', async () => { + await Exec.exec('brew', ['install', 'qemu'], {env: envs}); + }); + } + const qemuBin = await Install.qemuBin(); await core.group('QEMU version', async () => { - await Exec.exec(`qemu-system-${qemuArch} --version`); + await Exec.exec(qemuBin, ['--version']); }); // lima might already be started on the runner so env var added in download @@ -617,29 +622,42 @@ EOF`, return await io .which('lima', true) .then(res => { - core.debug(`docker.Install.limaAvailable ok: ${res}`); + core.debug(`docker.Install.limaInstalled ok: ${res}`); return true; }) .catch(error => { - core.debug(`docker.Install.limaAvailable error: ${error}`); + core.debug(`docker.Install.limaInstalled error: ${error}`); return false; }); } - private static async qemuArch(): Promise { + private static async qemuBin(): Promise { switch (os.arch()) { case 'x64': { - return 'x86_64'; + return `qemu-system-x86_64`; } case 'arm64': { - return 'aarch64'; + return `qemu-system-aarch64`; } default: { - return os.arch(); + return `qemu-system-${os.arch()}`; } } } + private static async qemuInstalled(): Promise { + return await io + .which(await Install.qemuBin(), true) + .then(res => { + core.debug(`docker.Install.qemuInstalled ok: ${res}`); + return true; + }) + .catch(error => { + core.debug(`docker.Install.qemuInstalled error: ${error}`); + return false; + }); + } + public static async getRelease(version: string): Promise { const url = `https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json`; const http: httpm.HttpClient = new httpm.HttpClient('docker-actions-toolkit'); diff --git a/yarn.lock b/yarn.lock index 83d207d3..87e30bce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3403,13 +3403,13 @@ __metadata: linkType: hard "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" dependencies: path-key: ^3.1.0 shebang-command: ^2.0.0 which: ^2.0.1 - checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + checksum: 8d306efacaf6f3f60e0224c287664093fa9185680b2d195852ba9a863f85d02dcc737094c6e512175f8ee0161f9b87c73c6826034c2422e39de7d6569cf4503b languageName: node linkType: hard