From 8bd5f3318ff0de35bd0d559ff377aec5f5d7acbd Mon Sep 17 00:00:00 2001 From: Mathieu Rochette Date: Thu, 21 Nov 2024 23:38:56 +0100 Subject: [PATCH] move to PHPCSStandards --- .github/workflows/build.yml | 4 +++- Dockerfile | 24 +++++++++++++++++++++--- README.md | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca58176..0d8aaae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,4 +48,6 @@ jobs: with: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=3.11.1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8ef7a22..06f0003 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,23 @@ -FROM php:8.3-alpine +FROM php:8.4-alpine AS base -RUN apk add --no-cache patch +FROM base AS builder -RUN pear install PHP_CodeSniffer-3.7.2 +RUN curl -OL https://phar.io/releases/phive.phar && \ + curl -OL https://phar.io/releases/phive.phar.asc && \ + apk add --no-cache --virtual .gpg gpg gpg-agent && \ + gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \ + gpg --verify phive.phar.asc phive.phar && \ + chmod +x phive.phar + +ARG VERSION + +RUN ./phive.phar install --trust-gpg-keys 689DAD778FF08760E046228BA978220305CD5C32 phpcs@$VERSION +RUN ./phive.phar install --trust-gpg-keys 689DAD778FF08760E046228BA978220305CD5C32 phpcbf@$VERSION + +RUN /tools/phpcs --version +RUN /tools/phpcbf --version + +FROM base + +COPY --from=builder /tools/phpcs /usr/bin/phpcs +COPY --from=builder /tools/phpcbf /usr/bin/phpcbf \ No newline at end of file diff --git a/README.md b/README.md index f1bc63f..93d3321 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHPCS -This is a docker image for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) +This is a docker image for [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) ## Usage