From 4c869ee16c33286fd501448d1a4ce673712778a8 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 20 Jul 2026 18:40:38 +0100 Subject: [PATCH] ci: Build separate pre-commit docker image (#7831) --- .github/workflows/build-nix-images.yml | 4 +-- .github/workflows/build-packaging-images.yml | 4 +-- .github/workflows/build-pre-commit-image.yml | 36 +++++++++++++++++++ bin/pre-commit/Dockerfile | 38 ++++++++++++++++++++ 4 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-pre-commit-image.yml create mode 100644 bin/pre-commit/Dockerfile diff --git a/.github/workflows/build-nix-images.yml b/.github/workflows/build-nix-images.yml index 54911ef6e0..da28b8db49 100644 --- a/.github/workflows/build-nix-images.yml +++ b/.github/workflows/build-nix-images.yml @@ -1,4 +1,4 @@ -name: Build Nix Docker images +name: Build `nix` Docker images on: push: @@ -36,7 +36,7 @@ defaults: jobs: build-merge: - name: Build and push nix-${{ matrix.distro.name }} + name: Build and push `nix-${{ matrix.distro.name }}` image permissions: contents: read packages: write diff --git a/.github/workflows/build-packaging-images.yml b/.github/workflows/build-packaging-images.yml index 3633847ef3..e72ea876a7 100644 --- a/.github/workflows/build-packaging-images.yml +++ b/.github/workflows/build-packaging-images.yml @@ -1,4 +1,4 @@ -name: Build packaging Docker images +name: Build `packaging` Docker images on: push: @@ -26,7 +26,7 @@ defaults: jobs: build-merge: - name: Build and push packaging-${{ matrix.distro.name }} + name: Build and push `packaging-${{ matrix.distro.name }}` image permissions: contents: read packages: write diff --git a/.github/workflows/build-pre-commit-image.yml b/.github/workflows/build-pre-commit-image.yml new file mode 100644 index 0000000000..1d0a479846 --- /dev/null +++ b/.github/workflows/build-pre-commit-image.yml @@ -0,0 +1,36 @@ +name: Build `pre-commit` Docker image + +on: + push: + branches: + - develop + paths: + - ".github/workflows/build-pre-commit-image.yml" + - "bin/pre-commit/Dockerfile" + pull_request: + paths: + - ".github/workflows/build-pre-commit-image.yml" + - "bin/pre-commit/Dockerfile" + workflow_dispatch: + +concurrency: + # Read `on-trigger.yml` for the rationale behind this concurrency group name. + group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' && github.sha || github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + build-merge: + name: Build and push `pre-commit` image + permissions: + contents: read + packages: write + uses: XRPLF/actions/.github/workflows/build-multiarch-image.yml@ee03d31bcc4501d7599dc1b1ecd7a34af582ad1c + with: + image_name: xrpld/pre-commit + dockerfile: bin/pre-commit/Dockerfile + base_image: ubuntu:26.04 + push: ${{ github.event_name == 'push' }} diff --git a/bin/pre-commit/Dockerfile b/bin/pre-commit/Dockerfile new file mode 100644 index 0000000000..fcd07146c3 --- /dev/null +++ b/bin/pre-commit/Dockerfile @@ -0,0 +1,38 @@ +ARG BASE_IMAGE=ubuntu:26.04 + +FROM ${BASE_IMAGE} + +SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] +ENTRYPOINT ["/bin/bash"] + +ARG DEBIAN_FRONTEND=noninteractive + +RUN <