Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wpcs workflow and code quality improved #31

Merged
merged 14 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
with:
find: "Version: *[0-9.]*"
replace: "Version: ${{ steps.tag_version.outputs.new_version }}"
include: "openedx-woocommerce-plugin.php"
include: "class-openedx-woocommerce-plugin.php"

- name: Update php file version - define statement
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "(define\\( 'OPENEDX_WOOCOMMERCE_PLUGIN_VERSION', ')([^']*)(.*);"
replace: "define( 'OPENEDX_WOOCOMMERCE_PLUGIN_VERSION', '${{ steps.tag_version.outputs.new_version }}' );"
include: "openedx-woocommerce-plugin.php"
include: "class-openedx-woocommerce-plugin.php"

- name: Update README version
uses: jacobtomlinson/gha-find-replace@v3
Expand All @@ -60,7 +60,7 @@ jobs:
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_tag }}"
file_pattern: README.txt CHANGELOG.md openedx-woocommerce-plugin.php
file_pattern: README.txt CHANGELOG.md class-openedx-woocommerce-plugin.php

release:
needs: bumpversion
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/linting.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/wordpress-cs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: WordPress Coding Standards check
on:
pull_request

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: 'latest'
ini-values: memory_limit=1G'
coverage: none
tools: cs2pr

- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Run PHPCS checks
id: phpcs
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml --standard=phpcs.xml

- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml
Loading