Skip to content

Commit

Permalink
Add PCP GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndkauboy committed Nov 8, 2024
1 parent 8569bae commit 9581f8b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/wordpress-plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Plugin Check
on:
pull_request:
push:
branches:
- main
release:
types: [ published ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Composer install
uses: shivammathur/setup-php@v2
with:
php-version: latest
coverage: none
tools: wp-cli
- run: composer install --no-dev --ignore-platform-reqs --optimize-autoloader

- name: Assets build
run: |
npm install
npm run build
- name: Install latest version of dist-archive-command
run: wp package install wp-cli/dist-archive-command:@stable

- name: Build plugin
run: |
wp dist-archive . ./${{ github.event.repository.name }}.zip
mkdir tmp-build
unzip ${{ github.event.repository.name }}.zip -d tmp-build
- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: ./tmp-build/${{ github.event.repository.name }}

0 comments on commit 9581f8b

Please sign in to comment.