mirror-llvm-project/.github/workflows/libcxx-build-containers.yml
Louis Dionne ba61615b65
[libc++] Rename pre-commit CI workflows (#211844)
Since we're expanding libc++'s pre-commit CI to add other types of
tests, (e.g. tools tests, performance tests, etc), it makes sense to be
a bit more precise about what each workflow does, and to use a
consistent pattern across workflow names.

Also, update stale references to old names in the documentation and in
some infrastructure scripts.
2026-07-24 14:56:19 -04:00

64 lines
2.1 KiB
YAML

# 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: "[libc++] Build CI Docker images"
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'
strategy:
matrix:
image_name: ['libcxx-linux-builder-base', 'libcxx-linux-builder', 'libcxx-android-builder']
permissions:
packages: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
# 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 image
run: docker compose --file libcxx/utils/ci/docker/docker-compose.yml build "${{ matrix.image_name }}"
env:
TAG: ${{ github.sha }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push the image
if: github.event_name == 'push'
run: docker compose --file libcxx/utils/ci/docker/docker-compose.yml push "${{ matrix.image_name }}"
env:
TAG: ${{ github.sha }}