Skip to content

[libc++] Reorganize and fix the libc++ CI dockerfiles #310

[libc++] Reorganize and fix the libc++ CI dockerfiles

[libc++] Reorganize and fix the libc++ CI dockerfiles #310

# This file defines an action that builds the various Docker images used to run
# libc++ CI whenever modifications to those Docker files are pushed to `main`.
#
# The images are pushed to the LLVM package registry at https://github.com/orgs/llvm/packages
# and tagged appropriately. The selection of which Docker image version is used by the libc++
# CI nodes at any given point is controlled from the workflow files themselves.
name: Build Docker images for libc++ CI
permissions:
contents: read
on:
push:
branches:
- main
paths:
- 'libcxx/utils/ci/docker/**'
- '.github/workflows/libcxx-build-containers.yml'
pull_request:
paths:
- 'libcxx/utils/ci/docker/**'
- '.github/workflows/libcxx-build-containers.yml'
jobs:
build-and-push:
runs-on: ubuntu-24.04
if: github.repository_owner == 'llvm'
permissions:
packages: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# The default Docker storage location for GitHub Actions doesn't have
# enough disk space, so change it to /mnt, which has more disk space.
- name: Change Docker storage location
run: |
sudo mkdir /mnt/docker
echo '{ "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: Build the base image
run: docker compose --file libcxx/utils/ci/docker/docker-compose.yml build libcxx-linux-builder-base
env:
TAG: ${{ github.sha }}
- name: Build the Linux Github Actions image
run: docker compose --file libcxx/utils/ci/docker/docker-compose.yml build libcxx-linux-builder
env:
TAG: ${{ github.sha }}
- name: Build the Android builder image
run: docker compose --file libcxx/utils/ci/docker/docker-compose.yml build libcxx-android-builder
env:
TAG: ${{ github.sha }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push the images
if: github.event_name == 'push'
run: docker compose push libcxx-linux-builder-base libcxx-linux-builder libcxx-android-builder