Update dependencies #752
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Checks | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
php-lint-test: | |
name: "PHP ${{ matrix.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", "8.4"] | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN_IR }} | |
- name: Remote refs | |
uses: ./.github/actions/upstream-refs | |
id: remote-refs | |
- name: Checkout premium projects repo | |
uses: actions/checkout@v4 | |
with: | |
path: premium | |
token: ${{ secrets.ACCESS_TOKEN_IR }} | |
repository: ${{ secrets.PREMIUM_PROJECTS_REPO }} | |
ref: ${{ fromJSON(steps.remote-refs.outputs.result).premium || 'main' }} | |
- name: Setup Environment | |
uses: ./.github/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: Remote refs | |
uses: ./.github/actions/upstream-refs | |
id: remote-refs | |
- name: Checkout premium projects repo | |
uses: actions/checkout@v4 | |
with: | |
path: premium | |
token: ${{ secrets.ACCESS_TOKEN_IR }} | |
repository: ${{ secrets.PREMIUM_PROJECTS_REPO }} | |
ref: ${{ fromJSON(steps.remote-refs.outputs.result).premium || 'main' }} | |
- name: Setup Environment | |
uses: ./.github/actions/setup | |
with: | |
enable-wireit-cache: true | |
- name: Lint | |
run: "pnpm run lint:js" | |
- name: Typecheck | |
run: pnpm run typecheck | |
- name: Build | |
run: pnpm run build | |
- name: Bundle | |
run: pnpm run bundle:all | |
e2e-tests: | |
name: "E2E Tests - PHP: ${{ matrix.php }}, WP: ${{ matrix.wp }}" | |
if: github.repository == 'wpsocio/wp-projects' | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Least version required and the latest version | |
php: ["7.4", "8.3"] | |
wp: ["6.4", "master"] | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN_IR }} | |
- name: Remote refs | |
uses: ./.github/actions/upstream-refs | |
id: remote-refs | |
- name: Checkout premium projects repo | |
uses: actions/checkout@v4 | |
with: | |
path: premium | |
token: ${{ secrets.ACCESS_TOKEN_IR }} | |
repository: ${{ secrets.PREMIUM_PROJECTS_REPO }} | |
ref: ${{ fromJSON(steps.remote-refs.outputs.result).premium || 'main' }} | |
- name: Setup Environment | |
uses: ./.github/actions/setup | |
with: | |
enable-wireit-cache: true | |
php-version: ${{ matrix.php }} | |
- name: Setup PHP | |
run: "pnpm run setup:php" | |
- name: Build | |
run: pnpm run build | |
- name: Install Playwright dependencies | |
run: | | |
npx playwright install chromium firefox webkit --with-deps | |
- name: Update wp-env | |
run: | | |
contents="$(jq '.core = "WordPress/WordPress#${{ matrix.wp }}" | .phpVersion = "${{ matrix.php }}"' .wp-env.json)" | |
echo -E "${contents}" > .wp-env.json | |
- name: Start WordPress Environment | |
run: | | |
pnpm run env-start | |
- name: Run tests | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
run: pnpm run test:e2e | |
- name: Upload debug artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: e2e-artifacts-wp-${{ matrix.wp }}-php-${{ matrix.php }} | |
path: | | |
artifacts/ | |
!artifacts/test-results | |
if-no-files-found: ignore | |
- name: Stop WordPress Environment | |
run: | | |
pnpm run env-stop |