From 33ab9ada96c25ceaf649d097e14a0a71ddf82f1a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 Sep 2022 16:26:33 +1200 Subject: [PATCH 1/4] Run lint with docker --- .github/workflows/linter.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 2c98d11b80..77bd982f13 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -19,16 +19,8 @@ jobs: - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - - - name: Install dependencies - uses: php-actions/composer@v6 - with: - php_version: '8.0' - args: --profile --ignore-platform-reqs - - name: Run Linter - run: ./vendor/bin/phpcs -p + uses: docker + run: | + docker run --rm -v $(pwd):/app -w /app composer sh -c \ + "composer install --profile --ignore-platform-reqs && composer lint" From e4c1188498a9d1eafe22a1ea7c74b21a47436222 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 Sep 2022 16:47:47 +1200 Subject: [PATCH 2/4] Use composer directly --- .github/workflows/linter.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 77bd982f13..92c63f2ab5 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -2,7 +2,7 @@ name: "Linter" on: [pull_request] jobs: - tests: + lint: name: Linter runs-on: ubuntu-latest @@ -20,7 +20,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} - name: Run Linter - uses: docker + uses: docker://composer run: | - docker run --rm -v $(pwd):/app -w /app composer sh -c \ - "composer install --profile --ignore-platform-reqs && composer lint" + composer install --profile --ignore-platform-reqs + composer lint From 801898a9e26bdb935d5ceadff07b6aae867df8a8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 Sep 2022 16:52:33 +1200 Subject: [PATCH 3/4] Use composer container --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 92c63f2ab5..418c3830b7 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,6 +5,7 @@ jobs: lint: name: Linter runs-on: ubuntu-latest + container: composer steps: - name: Checkout repository @@ -20,7 +21,6 @@ jobs: if: ${{ github.event_name == 'pull_request' }} - name: Run Linter - uses: docker://composer run: | composer install --profile --ignore-platform-reqs composer lint From 3e8da28e709047458635a7843ade206bf89e39e8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 Sep 2022 17:00:11 +1200 Subject: [PATCH 4/4] Run with docker raw --- .github/workflows/linter.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 418c3830b7..ffb8a097d3 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,22 +5,16 @@ jobs: lint: name: Linter runs-on: ubuntu-latest - container: composer steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - name: Run Linter run: | - composer install --profile --ignore-platform-reqs - composer lint + docker run --rm -v $PWD:/app composer sh -c \ + "composer install --profile --ignore-platform-reqs && composer lint"