Skip to content

Commit

Permalink
split up utility targets from main dockerfile
Browse files Browse the repository at this point in the history
We can not use bake with linked targets to split
up ld, sdk-extras and llvm in own subdirectories.

Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Feb 13, 2023
1 parent 3d00d09 commit 46e79b8
Show file tree
Hide file tree
Showing 40 changed files with 542 additions and 274 deletions.
115 changes: 48 additions & 67 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ on:
workflow_dispatch:
push:
branches:
- 'master'
- "master"
tags:
- 'v*'
- "v*"
pull_request:
branches:
- 'master'
- "master"

jobs:
validate:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: Validate
- name: Validate
uses: docker/bake-action@v2
with:
targets: validate
Expand All @@ -35,118 +33,103 @@ jobs:
fail-fast: false
matrix:
include:
-
image: alpine:3.13
- image: alpine:3.13
typ: alpine
allow-failure: false
-
image: alpine:3.14
- image: alpine:3.14
typ: alpine
allow-failure: false
-
image: alpine:3.15
- image: alpine:3.15
typ: alpine
allow-failure: false
-
image: alpine:3.16
- image: alpine:3.16
typ: alpine
allow-failure: false
-
image: alpine:3.17
- image: alpine:3.17
typ: alpine
allow-failure: false
-
image: alpine:edge
- image: alpine:edge
typ: alpine
allow-failure: true
-
image: debian:buster-backports
- image: debian:buster-backports
typ: debian
allow-failure: true
-
image: debian:bullseye
- image: debian:bullseye
typ: debian
allow-failure: false
-
image: debian:bookworm
- image: debian:bookworm
typ: debian
# FIXME: Set to false when https://github.com/tonistiigi/xx/issues/95 fixed
allow-failure: true
-
image: debian:sid
- image: debian:sid
typ: debian
allow-failure: true
-
image: ubuntu:20.04
- image: ubuntu:20.04
typ: debian
allow-failure: false
-
image: ubuntu:22.04
- image: ubuntu:22.04
typ: debian
allow-failure: false
-
image: redhat/ubi8
- image: redhat/ubi8
typ: rhel
allow-failure: false
-
image: fedora:35
- image: fedora:35
typ: rhel
allow-failure: false
-
image: fedora:36
- image: fedora:36
typ: rhel
allow-failure: false
-
image: fedora:37
- image: fedora:37
typ: rhel
allow-failure: false
-
image: centos:7
- image: centos:7
typ: rhel
allow-failure: false
-
image: rockylinux/rockylinux:8
- image: rockylinux/rockylinux:8
typ: rhel
allow-failure: false
-
image: oraclelinux:8
- image: oraclelinux:8
typ: rhel
allow-failure: false
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Test
- name: Test
uses: docker/bake-action@v2
if: ${{ matrix.typ != 'rhel' }}
with:
targets: test-${{ matrix.typ }}
targets: test
set: |
test-${{ matrix.typ }}.args.TEST_BASE_IMAGE=${{ matrix.image }}
test-base.args.TEST_BASE_IMAGE=${{ matrix.image }}
env:
TEST_BASE_TYPE: ${{ matrix.typ }}
- name: Test info
uses: docker/bake-action@v2
if: ${{ matrix.typ == 'rhel' }}
with:
targets: test-info
set: |
test-base.args.TEST_BASE_IMAGE=${{ matrix.image }}
env:
TEST_BASE_TYPE: ${{ matrix.typ }}

build:
runs-on: ubuntu-latest
needs:
- validate
- test
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Docker meta
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
Expand All @@ -157,15 +140,13 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
bake-target: meta-helper
-
name: Login to DockerHub
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build
- name: Build
uses: docker/bake-action@v2
with:
files: |
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/ld.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
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:
branches:
- 'master'
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:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false
matrix:
include:
- target: linux-arm64
- target: linux-amd64
- target: linux-armv7
- target: linux-armv6
- target: linux-ppc64le
- target: linux-386
- target: linux-riscv64
- target: linux-s390x
- target: windows-amd64
- target: windows-386
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: binutils-${{ matrix.target }}-alpine

ld:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false
matrix:
include:
- target: linux-arm64
- target: linux-amd64
- target: linux-armv7
- target: linux-armv6
- target: linux-ppc64le
- target: linux-386
- target: linux-riscv64
- target: linux-s390x
- target: windows-amd64
- target: windows-386

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: ld-${{ matrix.target }}-tgz
52 changes: 52 additions & 0 deletions .github/workflows/llvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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:
branches:
- "master"
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
Loading

0 comments on commit 46e79b8

Please sign in to comment.