From 17bc18bb05034c78f2ede32a8bbefcb428ed3f54 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Sat, 15 Feb 2025 12:13:25 +0100 Subject: [PATCH] display binfmt version Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/ci.yml | 19 +++++++++++++++++++ src/main.ts | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0a5f5e..a62eeb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,3 +102,22 @@ jobs: - name: Available platforms run: echo ${{ steps.qemu.outputs.platforms }} + + version: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: + - tonistiigi/binfmt:master + - tonistiigi/binfmt:latest + - tonistiigi/binfmt:qemu-v7.0.0 + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up QEMU + uses: ./ + with: + image: ${{ matrix.image }} diff --git a/src/main.ts b/src/main.ts index 9d1386c..0f33f23 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,6 +33,16 @@ actionsToolkit.run( }); }); + await core.group(`Binfmt version`, async () => { + await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--version'], { + ignoreReturnCode: true + }).then(res => { + if (res.stderr.length > 0 && res.exitCode != 0) { + throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'); + } + }); + }); + await core.group(`Installing QEMU static binaries`, async () => { await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--install', input.platforms], { ignoreReturnCode: true