Update README with project description and Playground link #42
Workflow file for this run
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: | |
| - trunk | |
| - 'copilot/**' | |
| pull_request: | |
| branches: | |
| - trunk | |
| - 'copilot/**' | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # JavaScript unit tests (Jest, no Docker needed) | |
| # --------------------------------------------------------------------------- | |
| js-tests: | |
| name: JS Unit Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run JS unit tests | |
| run: npm run test:unit | |
| # --------------------------------------------------------------------------- | |
| # PHP unit tests — run inside wp-env (Docker) | |
| # --------------------------------------------------------------------------- | |
| php-tests: | |
| name: "PHP ${{ matrix.php }} Tests (wp-env)" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # PRs test only the oldest and newest supported versions. | |
| # Pushes to trunk/copilot branches test the full range. | |
| php: ${{ github.event_name == 'push' && fromJSON('["7.4","8.0","8.1","8.2","8.3","8.4","8.5"]') || fromJSON('["7.4","8.5"]') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Override PHP version | |
| run: | | |
| echo '{ "phpVersion": "${{ matrix.php }}" }' > .wp-env.override.json | |
| - name: Start wp-env | |
| run: npx wp-env start | |
| env: | |
| # wp-env pulls Docker images; increase timeout for CI. | |
| WP_ENV_LIFECYCLE_TIMEOUT: 300 | |
| - name: Install Composer dependencies | |
| run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/multi-author-posts -- composer install --no-interaction | |
| - name: Run PHP tests via wp-env | |
| run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/multi-author-posts -- vendor/bin/phpunit | |
| - name: Stop wp-env | |
| if: always() | |
| run: npx wp-env stop |