[Github] Add github-automation container (#200704)

There are several jobs that use the pattern:
1. Checkout github-automation.py script.
2. Install dependencies for github-automation.py script.
3. Run the github-automation.py script.

We can consolidate a lot of this logic into the container and simplify
the workflows. This may also speed them up the workflow jobs slightly,
but most of them are already pretty fast, so it may not make a big
difference.
This commit is contained in:
Tom Stellard 2026-06-09 13:27:06 -07:00 committed by GitHub
parent 8c0f84e7a7
commit 596e95cc51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View file

@ -10,6 +10,7 @@ on:
paths:
- .github/workflows/build-ci-container-tooling.yml
- '.github/workflows/containers/github-action-ci-tooling/**'
- llvm/utils/git/github-automation.py
- llvm/utils/git/requirements_formatting.txt
- llvm/utils/git/requirements_linting.txt
- '.github/actions/build-container/**'
@ -18,6 +19,7 @@ on:
paths:
- .github/workflows/build-ci-container-tooling.yml
- '.github/workflows/containers/github-action-ci-tooling/**'
- llvm/utils/git/github-automation.py
- llvm/utils/git/requirements_formatting.txt
- llvm/utils/git/requirements_linting.txt
- '.github/actions/build-container/**'
@ -39,6 +41,11 @@ jobs:
- container-name: abi-tests
test-command: 'cd $HOME && abi-compliance-checker --help'
target: abi-tests
- container-name: github-automation
test-command: 'true'
target: github-automation
context: llvm/utils/git/
steps:
- name: Checkout LLVM
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@ -48,6 +55,7 @@ jobs:
.github/workflows/containers/github-action-ci-tooling/
llvm/utils/git/requirements_formatting.txt
llvm/utils/git/requirements_linting.txt
llvm/utils/git/github-automation.py
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
.github/actions/build-container
@ -58,6 +66,7 @@ jobs:
dockerfile: .github/workflows/containers/github-action-ci-tooling/Dockerfile
target: ci-container-${{ matrix.target || format('code-{0}', matrix.container-name) }}
test-command: ${{ matrix.test-command }}
context: ${{ matrix.context }}
push-ci-container:
if: github.event_name == 'push'

View file

@ -113,3 +113,16 @@ RUN apt-get update && \
universal-ctags && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
FROM base as ci-container-github-automation
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-git \
python3-github && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER gha
ADD github-automation.py /usr/local/bin/