Skip to content

phpcs fix

phpcs fix #124

Workflow file for this run

name: Unit Tests Coverage
on: [push, pull_request]
jobs:
create-zip:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Zip repository
run: zip -r plugin.zip .
- name: Upload zip file
uses: actions/upload-artifact@v4
with:
name: plugin-zip
path: plugin.zip
- name: Get artifact path
id: get-artifact-path
run: echo "ARTIFACT_PATH=$(find ${{ github.workspace }} -name 'plugin.zip')" >> $GITHUB_ENV
run-unit-tests:
needs: create-zip
runs-on: ubuntu-latest
steps:
- name: Setup wp-env
uses: godaddy-wordpress/setup-wp-env@v1
with:
core: "WordPress/WordPress"
phpVersion: "8.1"
plugins: ${{ steps.get-artifact-path.outputs.path }}
- name: Checkout
uses: actions/checkout@v4
- name: Start WP ENV
run: |
npm run wp-env start
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "16"
cache: "npm"
- name: Install dependencies
run: |
npm install
- name: Install Composer
run: |
composer install
- name: Run unit tests
run: |
npm run test:unit
create-production-zip:
needs: run-unit-tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Production ZIP
run: |
zip -r serve-static.zip . -x ".github/workflows/*" -x "tests/*" -x ".git/*" -x ".github/*" -x ".gitignore" -x ".phpunit.result.cache" -x ".wp-env.json" -x "composer.json" -x "composer.lock" -x "package-lock.json" -x "package.json" -x "phpunit.xml.dist"
- name: Upload Production ZIP
uses: actions/upload-artifact@v4
with:
name: production
path: serve-static.zip