Skip to content

Commit

Permalink
Merge pull request #103 from tonistiigi/base-split
Browse files Browse the repository at this point in the history
split up utility targets from main dockerfile
  • Loading branch information
crazy-max authored Jul 11, 2023
2 parents ebe730a + cf86c5b commit bb1ced0
Show file tree
Hide file tree
Showing 41 changed files with 555 additions and 224 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/bats-assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ on:
push:
branches:
- 'master'
- 'v2'
paths:
- '.github/workflows/bats-assert.yml'
- 'util/bats-assert/**'
pull_request:
branches:
- 'master'
paths:
- '.github/workflows/bats-assert.yml'
- 'util/bats-assert/**'
Expand All @@ -19,22 +16,29 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Test
working-directory: ./util/bats-assert
run: docker buildx bake test
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1.6.0
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Publish
if: github.ref == 'pull_refs/heads/master'
working-directory: ./util/bats-assert
run: docker buildx bake all --push
uses: docker/bake-action@v2
with:
workdir: ./util/bats-assert
targets: all
push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,18 @@ jobs:
uses: docker/setup-buildx-action@v2
-
name: Test
if: ${{ matrix.typ != 'rhel' }}
uses: docker/bake-action@v2
with:
targets: test-${{ matrix.typ }}
targets: test
set: |
test-${{ matrix.typ }}.args.TEST_BASE_IMAGE=${{ matrix.image }}
-
name: Test (info)
if: ${{ matrix.typ == 'rhel' }}
uses: docker/bake-action@v2
with:
targets: test-info
set: |
test-${{ matrix.typ }}.args.TEST_BASE_IMAGE=${{ matrix.image }}
Expand Down
131 changes: 131 additions & 0 deletions .github/workflows/ld.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: ld

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
paths:
- 'src/ld/**'
pull_request:
paths:
- 'src/ld/**'

jobs:
ld64:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
files: |
./docker-bake.hcl
targets: ld64-tgz

binutils-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake binutils --print | jq -cr '.group.binutils.targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
binutils:
runs-on: ubuntu-latest
needs:
- binutils-targets
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.binutils-targets.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,scope=${{ matrix.target }}
ld-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake ld-static-tgz --print | jq -cr '.group."ld-static-tgz".targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
ld:
runs-on: ubuntu-latest
needs:
- ld-targets
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.ld-targets.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,scope=${{ matrix.target }}
59 changes: 59 additions & 0 deletions .github/workflows/llvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: llvm

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
paths:
- 'src/llvm/**'
pull_request:
paths:
- 'src/llvm/**'

jobs:
compiler-rt:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
files: |
./docker-bake.hcl
targets: compiler-rt

libcxx:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
files: |
./docker-bake.hcl
targets: compiler-rt
39 changes: 39 additions & 0 deletions .github/workflows/sdk-extras.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: sdk-extras

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
paths:
- 'src/sdk-extras/**'
pull_request:
paths:
- 'src/sdk-extras/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
files: |
./docker-bake.hcl
targets: sdk-extras
Loading

0 comments on commit bb1ced0

Please sign in to comment.