-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] Add a Github action to build libc++'s Docker images (#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.
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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 | ||
packages: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'libcxx/utils/ci/**' | ||
- '.github/workflows/libcxx-build-containers.yml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'libcxx/utils/ci/**' | ||
- '.github/workflows/libcxx-build-containers.yml' | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'llvm' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build the Linux builder image and the Android builder image | ||
working-directory: libcxx/utils/ci | ||
run: | ||
- docker compose build actions-builder | ||
- docker compose build android-buildkite-builder | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push the Linux builder image | ||
if: github.event_name == 'push' | ||
working-directory: libcxx/utils/ci | ||
run: | ||
- docker compose push actions-builder | ||
env: | ||
TAG: libcxx-linux-builder:${{ github.sha }} | ||
|
||
- name: Push the Android builder image | ||
if: github.event_name == 'push' | ||
working-directory: libcxx/utils/ci | ||
run: | ||
- docker compose push android-buildkite-builder | ||
env: | ||
TAG: libcxx-android-builder:${{ github.sha }} |