[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:
parent
8c0f84e7a7
commit
596e95cc51
2 changed files with 22 additions and 0 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
Loading…
Reference in a new issue