Skip to content

Test initial run

Test initial run #2914

name: E2E Test Plugin (Legacy)
on:
pull_request:
paths-ignore:
- '**/*.md'
jobs:
e2e_test_plugin_legacy:
timeout-minutes: 10
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install NPM Deps
run: |
npm ci
npm run build
- name: Setup Frontend
run: |
NEXT_PUBLIC_WORDPRESS_URL=http://localhost:8080 FAUSTWP_SECRET_KEY=00000000-0000-4000-8000-000000000001 npm run dev:next:getting-started &
- name: Composer install
working-directory: plugins/faustwp
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
- name: Setup Containers
working-directory: plugins/faustwp
run: |
docker-compose build \
--build-arg WP_VERSION=6.4
docker-compose up -d
- name: Sleep 15 seconds
run: sleep 15
- name: Maybe upgrade WP DB
working-directory: plugins/faustwp
run: docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp core update-db --allow-root
- name: Init Testing Environment
working-directory: plugins/faustwp
run: docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) init-testing-environment.sh
- name: Install WP GraphQL
working-directory: plugins/faustwp
run: |
docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp plugin install wp-graphql --activate --allow-root
- name: Setup testing data
working-directory: plugins/faustwp
run: |
docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp db export tests/_data/dump.sql --allow-root
- name: Copy env file
working-directory: plugins/faustwp
run: cp .env.testing.example .env.testing
- name: Run Acceptance tests
working-directory: plugins/faustwp
run: vendor/bin/codecept run acceptance
- name: Run API tests
working-directory: plugins/faustwp
run: vendor/bin/codecept run api
- name: Upload Test Output
uses: actions/upload-artifact@v4
if: failure()
with:
name: failed-test-output
path: ${{ github.workspace }}/plugins/faustwp/tests/_output