From 0b8bb66ace80555d8e6963564f4cf54baf7f89c0 Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Wed, 15 Nov 2023 13:12:56 +0100 Subject: [PATCH] Workflow --- .github/workflows/codestyle.yml | 24 ---------------------- .github/workflows/codestyle2.yml | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/codestyle.yml create mode 100644 .github/workflows/codestyle2.yml diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml deleted file mode 100644 index 6372c73d..00000000 --- a/.github/workflows/codestyle.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CheckStyleAndLint - -on: - pull_request: - branches: [ "develop" ] - paths: - - "src/**.php" - - "example/**.php" - -jobs: - phpcs: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: [7.4, 8.1, 8.2, 8.3] - stability: [prefer-stable] - - name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 \ No newline at end of file diff --git a/.github/workflows/codestyle2.yml b/.github/workflows/codestyle2.yml new file mode 100644 index 00000000..1348548f --- /dev/null +++ b/.github/workflows/codestyle2.yml @@ -0,0 +1,35 @@ +name: CheckStyleAndLint + +on: + pull_request: + paths: + - "src/**.php" + - "example/**.php" + +jobs: + phpcs: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 8.1, 8.2] + stability: [prefer-stable] + + name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: cs2pr, phplint, phpcs + + - name: Run phplint + run: phplint --no-configuration --no-cache --no-interaction ./src/* ./example/* + + - name: Run phpcs + run: phpcs -q --report=checkstyle --extensions=php ./src/* | cs2pr