Skip to content

Add blueprints for WP Playground #427

Add blueprints for WP Playground

Add blueprints for WP Playground #427

Workflow file for this run

name: PR Checks
on:
pull_request:
types: [opened, synchronize]
env:
PREMIUM_REPO_REF: main
jobs:
php-lint-test:
name: "PHP: Lint, Test"
if: github.repository == 'wpsocio/wp-projects'
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
php: ["7.4", "8.0", "8.1", "8.2", "8.3"]
steps:
- name: Checkout this repo
uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN_IR }}
- name: Checkout premium projects repo
uses: actions/checkout@v4
with:
path: premium
token: ${{ secrets.ACCESS_TOKEN_IR }}
repository: ${{ secrets.PREMIUM_PROJECTS_REPO }}
ref: ${{ env.PREMIUM_REPO_REF }}
- name: Setup Environment
uses: ./actions/setup
with:
php-version: ${{ matrix.php }}
enable-wireit-cache: true
- name: Check syntax errors
env:
PNPM_FILTER: '--filter "./plugins/*" --filter "./premium/*/*"'
FIND_PATHS: ./plugins/*/src ./packages/php/*/src ./premium/*/*/src
FIND_IGNORE: '! -path "*/vendor/*" ! -path "*/node_modules/*"'
# For plugins, we need to check production dependencies as well
# So, let us install them in src/temp to avoid their exclusion inside vendor
run: |
pnpm -r --parallel ${{ env.PNPM_FILTER }} exec composer config vendor-dir src/temp
pnpm -r --parallel ${{ env.PNPM_FILTER }} exec composer install --no-dev
find ${{ env.FIND_PATHS }} ${{ env.FIND_IGNORE }} -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Setup PHP
run: "pnpm run setup:php"
- name: Lint
# Add premium/plugins/ to the lint path
run: "composer run lint -- premium/plugins/"
- name: Test
run: "pnpm run test:php"
if: matrix.php == '8.3'
js-lint-build:
name: "JS: Lint, Build and Test"
if: github.repository == 'wpsocio/wp-projects'
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN_IR }}
- name: Checkout premium projects repo
uses: actions/checkout@v4
with:
path: premium
token: ${{ secrets.ACCESS_TOKEN_IR }}
repository: ${{ secrets.PREMIUM_PROJECTS_REPO }}
ref: ${{ env.PREMIUM_REPO_REF }}
- name: Setup Environment
uses: ./actions/setup
with:
enable-wireit-cache: true
- name: Lint
run: "pnpm lint:js"
- name: Typecheck
run: pnpm typecheck
- name: Build
run: pnpm build
- name: Bundle
run: pnpm bundle:all