Skip to content

CI : make sure wp-cli is installed and surpress npm warnings #6

CI : make sure wp-cli is installed and surpress npm warnings

CI : make sure wp-cli is installed and surpress npm warnings #6

Workflow file for this run

name: 'fooconvert-build'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v3
# Set up PHP
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer, wp-cli
coverage: none
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
# Install Composer dependencies
- name: Install Composer dependencies
run: composer install --no-dev --prefer-dist
# Install npm dependencies
- name: Install NPM dependencies
run: npm install --silent --no-audit
# Extract version from package.json
- name: Extract Version
id: version
run: |
VERSION=$(jq -r '.version' package.json)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Create ZIP package
- name: Run Build and Create ZIP
run: npm run package:create-zip
# Unzip plugin package
- name: Unzip Plugin
run: |
mkdir -p extracted
unzip -o dist/fooconvert.v${{ env.VERSION }}.zip -d extracted/
# Run plugin check
- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: './extracted'
exclude-directories: 'vendor,src'