Skip to content

Commit

Permalink
Merge pull request #202 from crazy-max/binfmt-version
Browse files Browse the repository at this point in the history
display binfmt version
  • Loading branch information
crazy-max authored Feb 28, 2025
2 parents 5964de0 + 7ffe24a commit 2910929
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2910929

Please sign in to comment.