Skip to content

Commit 1799d57

Browse files
authored
[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.
1 parent bc6c068 commit 1799d57

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This file defines an action that builds the various Docker images used to run
2+
# libc++ CI whenever modifications to those Docker files are pushed to `main`.
3+
#
4+
# The images are pushed to the LLVM package registry at https://github.com/orgs/llvm/packages
5+
# and tagged appropriately. The selection of which Docker image version is used by the libc++
6+
# CI nodes at any given point is controlled from the workflow files themselves.
7+
8+
name: Build Docker images for libc++ CI
9+
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
on:
15+
push:
16+
branches:
17+
- main
18+
paths:
19+
- 'libcxx/utils/ci/**'
20+
- '.github/workflows/libcxx-build-containers.yml'
21+
pull_request:
22+
branches:
23+
- main
24+
paths:
25+
- 'libcxx/utils/ci/**'
26+
- '.github/workflows/libcxx-build-containers.yml'
27+
28+
jobs:
29+
build-and-push:
30+
runs-on: ubuntu-latest
31+
if: github.repository_owner == 'llvm'
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Build the Linux builder image and the Android builder image
37+
working-directory: libcxx/utils/ci
38+
run:
39+
- docker compose build actions-builder
40+
- docker compose build android-buildkite-builder
41+
42+
- name: Log in to GitHub Container Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Push the Linux builder image
50+
if: github.event_name == 'push'
51+
working-directory: libcxx/utils/ci
52+
run:
53+
- docker compose push actions-builder
54+
env:
55+
TAG: libcxx-linux-builder:${{ github.sha }}
56+
57+
- name: Push the Android builder image
58+
if: github.event_name == 'push'
59+
working-directory: libcxx/utils/ci
60+
run:
61+
- docker compose push android-buildkite-builder
62+
env:
63+
TAG: libcxx-android-builder:${{ github.sha }}

0 commit comments

Comments
 (0)