[llvm] [libc++] Add a Github action to build libc++'s Docker images (PR #110020)

Louis Dionne via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 11:04:04 PDT 2024


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/110020

This patch adds a Github action that runs whenever changes to the libc++ Docker images are pushed to `main`. The action will rebuild the Docker images and push them to LLVM's container registry so that we can then point to those images from our CI nodes.

>From 7c02307f4a790323e39a08eced170c27150b55b0 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Wed, 25 Sep 2024 14:02:35 -0400
Subject: [PATCH] [libc++] Add a Github action to build libc++'s Docker images

This patch adds a Github action that runs whenever changes to the
libc++ Docker images are pushed to `main`. The action will rebuild
the Docker images and push them to LLVM's container registry so that
we can then point to those images from our CI nodes.
---
 .../workflows/libcxx-build-containers.yaml    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 .github/workflows/libcxx-build-containers.yaml

diff --git a/.github/workflows/libcxx-build-containers.yaml b/.github/workflows/libcxx-build-containers.yaml
new file mode 100644
index 00000000000000..e4ff2141f1357e
--- /dev/null
+++ b/.github/workflows/libcxx-build-containers.yaml
@@ -0,0 +1,51 @@
+# 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 by the libc++ maintainers using a mechanism that
+# is not publicly visible for safety purposes.
+
+name: Build Docker images for libc++ CI
+
+permissions:
+  contents: read
+  packages: write
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'libcxx/utils/ci/**'
+
+jobs:
+  build-and-push:
+    runs-on: ubuntu-latest
+    if: github.repository_owner == 'llvm'
+
+    steps:
+    - uses: actions/checkout at v4
+
+    - name: Log in to GitHub Container Registry
+      uses: docker/login-action at v3
+      with:
+        registry: ghcr.io
+        username: ${{ github.actor }}
+        password: ${{ secrets.GITHUB_TOKEN }}
+
+    - name: Build and push the Linux builder image
+      working-directory: libcxx/utils/ci
+      run:
+        - docker compose build actions-builder
+        - docker compose push actions-builder
+      env:
+        TAG: libcxx-linux-builder:${{ github.sha }}
+
+    - name: Build and push the Android builder image
+      working-directory: libcxx/utils/ci
+      run:
+        - docker compose build android-buildkite-builder
+        - docker compose push android-buildkite-builder
+      env:
+        TAG: libcxx-android-builder:${{ github.sha }}



More information about the llvm-commits mailing list