From a56c5ac1024f49dfb4ae6e65050ed4d93ed1ade7 Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Thu, 30 Jun 2022 12:08:45 -0300 Subject: [PATCH 1/2] Run PHPCS in CI --- .github/workflows/phpcs.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/phpcs.yml diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 0000000..2146b72 --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -0,0 +1,33 @@ +name: PHPCS check +on: + push + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + phpcs: + name: PHPCS check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: "shivammathur/setup-php@v2" + with: + php-version: "7.4" + ini-values: "memory_limit=1G" + coverage: none + tools: cs2pr + + - name: Install Composer dependencies + uses: "ramsey/composer-install@v2" + + - name: Run PHPCS checks + continue-on-error: true + run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml + + - name: Show PHPCS results in PR + run: cs2pr ./phpcs-report.xml From b86d89515b69a822ccba73cb42f279dfa2df064f Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Thu, 30 Jun 2022 12:09:43 -0300 Subject: [PATCH 2/2] Add badge to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cd3af39..9ad9ebb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![PHPCS](https://github.com/woocommerce/wc-smooth-generator/actions/workflows/phpcs.yml/badge.svg)](https://github.com/woocommerce/wc-smooth-generator/actions/workflows/phpcs.yml) + # WooCommerce Smooth Generator A smooth products, customer and order generator using WP-CLI. Future versions will include scheduled auto generation functionality.