mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-18 06:01:32 +08:00
Update file(s) from wp-cli/.github
This commit is contained in:
parent
d11c03a74a
commit
1d917de86e
2 changed files with 38 additions and 9 deletions
3
.actrc
Normal file
3
.actrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Configuration file for nektos/act.
|
||||
# See https://github.com/nektos/act#configuration
|
||||
-P ubuntu-latest=shivammathur/node:latest
|
44
.github/workflows/code-quality.yml
vendored
44
.github/workflows/code-quality.yml
vendored
|
@ -3,58 +3,81 @@ name: Code Quality Checks
|
|||
on: pull_request
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Linter
|
||||
|
||||
lint: #-----------------------------------------------------------------------
|
||||
name: Lint PHP files
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check existence of composer.json file
|
||||
id: check_composer_file
|
||||
uses: andstor/file-existence-action@v1
|
||||
with:
|
||||
files: "composer.json"
|
||||
|
||||
- name: Set up PHP envirnoment
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
tools: cs2pr
|
||||
|
||||
- name: Get Composer cache Directory
|
||||
if: steps.check_composer_file.outputs.files_exists == 'true'
|
||||
id: composer-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Use Composer cache
|
||||
if: steps.check_composer_file.outputs.files_exists == 'true'
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
path: ${{ steps['composer-cache'].outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_composer_file.outputs.files_exists == 'true'
|
||||
run: composer install --dev --prefer-dist --no-progress --no-suggest
|
||||
run: COMPOSER_ROOT_VERSION=dev-master composer install --prefer-dist --no-progress --no-suggest
|
||||
|
||||
- name: Check existence of vendor/bin/parallel-lint file
|
||||
id: check_linter_file
|
||||
uses: andstor/file-existence-action@v1
|
||||
with:
|
||||
files: "vendor/bin/parallel-lint"
|
||||
|
||||
- name: Run Linter
|
||||
if: steps.check_linter_file.outputs.files_exists == 'true'
|
||||
run: vendor/bin/parallel-lint -j 10 . --exclude vendor --checkstyle | cs2pr --graceful-warnings
|
||||
run: vendor/bin/parallel-lint -j 10 . --exclude vendor --checkstyle | cs2pr
|
||||
|
||||
phpcs:
|
||||
phpcs: #----------------------------------------------------------------------
|
||||
name: PHPCS
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check existence of composer.json & phpcs.xml.dist files
|
||||
id: check_files
|
||||
uses: andstor/file-existence-action@v1
|
||||
with:
|
||||
files: "composer.json, phpcs.xml.dist"
|
||||
|
||||
- name: Set up PHP envirnoment
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
tools: cs2pr
|
||||
|
||||
- name: Get Composer cache Directory
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
id: composer-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Use Composer cache
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
uses: actions/cache@v1
|
||||
|
@ -63,14 +86,17 @@ jobs:
|
|||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
run: composer install --dev --prefer-dist --no-progress --no-suggest
|
||||
run: COMPOSER_ROOT_VERSION=dev-master composer install --prefer-dist --no-progress --no-suggest
|
||||
|
||||
- name: Check existence of vendor/bin/phpcs file
|
||||
id: check_phpcs_binary_file
|
||||
uses: andstor/file-existence-action@v1
|
||||
with:
|
||||
files: "vendor/bin/parallel-lint"
|
||||
files: "vendor/bin/phpcs"
|
||||
|
||||
- name: Run PHPCS
|
||||
if: steps.check_phpcs_binary_file.outputs.files_exists == 'true'
|
||||
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings
|
||||
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue