Tests #406
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 | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: [universe, main, develop] | |
| schedule: | |
| - cron: "0 2 * * *" # Daily at 2 AM | |
| jobs: | |
| wordpress-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php: ["8.2", "8.3"] | |
| wordpress: ["6.4", "latest"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 | |
| with: | |
| version: 8.6.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| composer install --no-interaction | |
| - name: Start WordPress ${{ matrix.wordpress }} | |
| run: | | |
| echo '{"core": "WordPress/WordPress#${{ matrix.wordpress }}", "phpVersion": "${{ matrix.php }}"}' > .wp-env.override.json | |
| pnpm wp-env start || echo "wp-env not configured" | |
| - name: Run WordPress tests | |
| run: pnpm run test:wp || echo "WordPress tests not configured" | |
| - name: Run E2E tests | |
| run: | | |
| npx playwright install --with-deps chromium || echo "Playwright not configured" | |
| pnpm run test:e2e || echo "E2E tests not configured" | |
| - name: Stop WordPress | |
| run: pnpm wp-env stop || echo "wp-env not configured" | |
| if: always() | |
| security-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 | |
| with: | |
| php-version: "8.2" | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Install Composer dependencies | |
| run: composer install --no-interaction --prefer-dist --no-dev | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 | |
| with: | |
| version: 8.6.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| - name: Install JS dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run security audits | |
| run: | | |
| pnpm audit --prod --audit-level=high | |
| composer audit | |
| continue-on-error: true |