Add comprehensive testing framework for both single site and multisite WordPress environments
This commit is contained in:
68
.github/workflows/wordpress-tests.yml
vendored
Normal file
68
.github/workflows/wordpress-tests.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
name: WordPress Environment Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
single-site-test:
|
||||
name: Single Site Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Install wp-env
|
||||
run: npm install -g @wordpress/env
|
||||
|
||||
- name: Setup WordPress Single Site
|
||||
run: |
|
||||
chmod +x bin/setup-test-env.sh
|
||||
bash bin/setup-test-env.sh single
|
||||
|
||||
- name: Install Cypress
|
||||
run: npm install cypress
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: npm run test:single:headless
|
||||
|
||||
multisite-test:
|
||||
name: Multisite Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Install wp-env
|
||||
run: npm install -g @wordpress/env
|
||||
|
||||
- name: Setup WordPress Multisite
|
||||
run: |
|
||||
chmod +x bin/setup-test-env.sh
|
||||
bash bin/setup-test-env.sh multisite
|
||||
|
||||
- name: Install Cypress
|
||||
run: npm install cypress
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: npm run test:multisite:headless
|
||||
Reference in New Issue
Block a user