0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 00:02:34 +01:00
construct/.github/workflows/docker.yml

99 lines
3.3 KiB
YAML
Raw Normal View History

#
# Build docker images
#
2023-03-31 23:52:30 +02:00
name: Docker Images
on:
workflow_dispatch:
inputs:
features:
type: string
description: JSON array of feature-set names to build images for.
distros:
type: string
description: JSON array of operating system distros to build for.
machines:
type: string
description: JSON array of machines to build for.
toolchains:
type: string
description: JSON array of compiler toolchains to build for.
2023-03-31 23:52:30 +02:00
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
ctor_id: ${{vars.DOCKER_ID}}
ctor_url: https://github.com/${{github.repository}}
2023-03-31 23:52:30 +02:00
jobs:
# Build the base-feature intermediate images (cached and not shipped).
2023-03-31 23:52:30 +02:00
base:
uses: ./.github/workflows/docker_prime.yml
with:
id: ${{github.env.ctor_id}}
url: ${{github.env.ctor_url}}
features: '["base"]'
distros: ${{github.event.inputs.distros || vars.DOCKER_DISTROS}}
machines: ${{github.event.inputs.machines || vars.DOCKER_MACHINES}}
2023-03-31 23:52:30 +02:00
test: ${{contains(github.events.push.commits[0].message, '[ci test]')}}
# Build the full-feature intermediate images (cached and not shipped).
2023-03-31 23:52:30 +02:00
full:
uses: ./.github/workflows/docker_prime.yml
needs: [base]
with:
id: ${{github.env.ctor_id}}
url: ${{github.env.ctor_url}}
features: '["full"]'
distros: ${{github.event.inputs.distros || vars.DOCKER_DISTROS}}
machines: ${{github.event.inputs.machines || vars.DOCKER_MACHINES}}
2023-03-31 23:52:30 +02:00
test: ${{contains(github.events.push.commits[0].message, '[ci test]')}}
# Build the leaf images (shipped and not cached)
2023-03-31 23:52:30 +02:00
built:
needs: [base, full]
runs-on: ${{matrix.machine}}
strategy:
fail-fast: false
matrix:
feature: ${{fromJSON(github.event.inputs.features || vars.DOCKER_FEATURES)}}
distro: ${{fromJSON(github.event.inputs.distros || vars.DOCKER_DISTROS)}}
machine: ${{fromJSON(github.event.inputs.machines || vars.DOCKER_MACHINES)}}
toolchain: ${{fromJSON(github.event.inputs.toolchains || vars.DOCKER_TOOLCHAINS)}}
2023-03-31 23:52:30 +02:00
exclude:
- distro: alpine-3.17
toolchain: gcc-10 # n/a on distro version
- distro: alpine-3.17
toolchain: gcc-11 # n/a on distro version
- distro: alpine-3.17
toolchain: clang-14 # n/a on distro version
- distro: ubuntu-22.04
toolchain: clang-15 # n/a on distro version
- machine: arm64
toolchain: gcc-12 # build hangs
- machine: arm64
toolchain: gcc-11 # build hangs
- machine: arm64
toolchain: gcc-10 # build hangs
- machine: arm64
distro: alpine-3.17
toolchain: clang-14 # smoketest crash
- machine: arm64
distro: alpine-3.17
toolchain: clang-15 # smoketest crash
steps:
- uses: actions/checkout@v3
- name: build
env:
ctor_features: ${{matrix.feature}}
ctor_distros: ${{matrix.distro}}
ctor_machines: ${{matrix.machine}}
ctor_toolchains: ${{matrix.toolchain}}
ctor_test: ${{contains(github.events.push.commits[0].message, '[ci test]')}}
run: |
docker/build-and-push-images.sh