Skip to content

Merge pull request #6819 from tonistiigi/test-shared-env-fix #12929

Merge pull request #6819 from tonistiigi/test-shared-env-fix

Merge pull request #6819 from tonistiigi/test-shared-env-fix #12929

Workflow file for this run

name: validate
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'v[0-9]+.[0-9]+'
tags:
- 'v*'
- 'dockerfile/*'
pull_request:
env:
SETUP_BUILDX_VERSION: "edge"
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
jobs:
prepare:
runs-on: ubuntu-24.04
outputs:
includes: ${{ steps.matrix.outputs.includes }}
steps:
-
name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
-
name: Generate matrix
id: generate
uses: docker/bake-action/subaction/matrix@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
with:
target: validate
fields: platforms
env:
GOLANGCI_LINT_MULTIPLATFORM: ${{ github.repository == 'moby/buildkit' && '1' || '' }}
ARCHUTIL_MULTIPLATFORM: ${{ github.repository == 'moby/buildkit' && '1' || '' }}
-
name: Add runner to matrix
id: matrix
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
INPUT_MATRIX: ${{ steps.generate.outputs.matrix }}
INPUT_PRIVATE-REPO: ${{ github.event.repository.private }}
with:
script: |
const matrix = JSON.parse(core.getInput('matrix'));
const privateRepo = core.getBooleanInput('private-repo');
matrix.forEach(job => {
if (job.platforms && job.platforms.startsWith('linux/arm') && !privateRepo) {
job.runner = 'ubuntu-24.04-arm';
} else {
job.runner = 'ubuntu-24.04';
}
});
core.info(JSON.stringify(matrix, null, 2));
core.setOutput('includes', JSON.stringify(matrix));
validate:
runs-on: ${{ matrix.runner }}
needs:
- prepare
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.prepare.outputs.includes) }}
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Validate
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
with:
targets: ${{ matrix.target }}
set: |
*.platform=${{ matrix.platforms }}