Skip to content

Commit

Permalink
Feature/test matrix (#56)
Browse files Browse the repository at this point in the history
* Update marketplace styles (#10)

* horizontal tabpanel filter bar.

* 3 card wide layout.

* other style improvements.

* Feature/marketplace update (#9)

* fix typo

* update marketplace module and component

* Update workflows to support Git Flow + WP branch naming conventions

* explicitly update marketplace in composer

* fix tests to reflect module updates

* update marketplace module again and fix nav styles for marketplace page

* npm audit fix

* update node and php used in runner for builds

* composer update to get latest marketplace module

* update versions in i18n workflow too

* Add the SSO module

* package updates (#15)

* package updates

update to latest cypress, wp-env, react-router-dom, testing-library/cypress, cypress-axe
also migrate cypress config and tests for latest version

* also update cypress-axe package

* fixes #13 - replace UpgradeHandler class with forge package (#17)

* add newfold secure passwords module (#18)

* Feature/add brand to container (#27)

* add brand value to container

* add install date to container

* Update/packages (#29)

* update author

* package updates

* use author website

* Update css color pallet / App UI (#28)

- Update css color props to match the Figma file style guide.

Other UI improvements:
- Increase app body top spacing.
- Update marketplace filter UI.
- Fix marketplace product price space when product is on sale.
- Update app home side images with better design.

Co-authored-by: Evan Mullins <evanrm@gmail.com>

* Add dependabot.yml file

* Update Al Ani's username

* Composer(deps): Bump newfold-labs/wp-module-data from 2.2.5 to 2.3 (#33)

Bumps [newfold-labs/wp-module-data](https://github.com/newfold-labs/wp-module-data) from 2.2.5 to 2.3.
- [Release notes](https://github.com/newfold-labs/wp-module-data/releases)
- [Commits](newfold-labs/wp-module-data@2.2.5...2.3)

---
updated-dependencies:
- dependency-name: newfold-labs/wp-module-data
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GitHub Actions(deps): Bump actions/checkout from 2 to 3 (#34)

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GitHub Actions(deps): Bump actions/cache from 2 to 3 (#36)

Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GitHub Actions(deps): Bump actions/upload-artifact from 1 to 3 (#37)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GitHub Actions(deps): Bump peter-evans/repository-dispatch from 1 to 2 (#40)

Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 1 to 2.
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](peter-evans/repository-dispatch@v1...v2)

---
updated-dependencies:
- dependency-name: peter-evans/repository-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GitHub Actions(deps): Bump actions/setup-node from 1 to 3 (#41)

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v1...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Delete deploy-github.yml

remove legacy workflow

* add matrix

add workflow, add replay and setup config for it

* set up wpVersion and phpVersion values

* add web tag to replay tests and use replay in all tests

* update packages

* target `main` in matrix workflow

* composer update

* update port in url to match wpenv

* update port in url again, use latest wp version

* fix navigation test

* version bump

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: A. Alani <38976631+aalani95@users.noreply.github.com>
Co-authored-by: Micah Wood <micah@wpscholar.com>
Co-authored-by: A. Alani <38976631+wpalani@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Jun 13, 2023
1 parent 518ea03 commit 7234de6
Show file tree
Hide file tree
Showing 11 changed files with 1,362 additions and 581 deletions.
146 changes: 146 additions & 0 deletions .github/workflows/cypress-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Cypress Test Matrix

on:
pull_request:
types: [ opened, edited, reopened, ready_for_review, synchronize ]
branches:
- 'main'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
test:
name: Run Cypress Test Matrix
runs-on: ubuntu-latest
timeout-minutes: 40

strategy:
fail-fast: false
matrix:
phpVersion:
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
wpVersion:
- '6.0'
- '6.1'
- '6.2'

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer, cs2pr

- name: Setup workflow context
id: workflow
working-directory: ${{ runner.temp }}
env:
REPO: ${{ github.repository }}
run: |
mkdir dist
echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT
echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer vendor directory
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Show versions
run: |
php --version
composer --version
node --version
npm --version
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install PHP Dependencies
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist

- name: NPM Install
run: npm install --legacy-peer-deps

- name: Build JavaScript
run: npm run build

- name: Create Distribution Copy
run: rsync -r --include-from=.distinclude --exclude-from=.distignore . ${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}

- name: List Distribution Files
working-directory: ${{ steps.workflow.outputs.DIST }}
run: find .

- name: Configure WordPress
run: |
echo '{"core": "WordPress/WordPress#tags/${{ matrix.wpVersion }}","phpVersion": "${{ matrix.phpVersion }}","plugins": [ "${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}" ] }' > .wp-env.override.json
- name: Configure Cypress
run: |
echo '{"wpVersion": "${{ matrix.wpVersion }}","phpVersion": "${{ matrix.phpVersion }}"}' > cypress.env.json
- name: Install WordPress
run: npx wp-env start --debug

- name: Run Cypress Tests
env:
RECORD_REPLAY_API_KEY: ${{ secrets.RECORD_REPLAY_API_KEY }}
if: ${{ github.repository != 'newfold-labs/wp-plugin-web' || env.RECORD_REPLAY_API_KEY == '' }}
run: npx cypress run

- name: Run Cypress Tests
uses: replayio/action-cypress@v0.2.8
env:
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: "php-${{ matrix.phpVersion }}, wp-${{ matrix.wpVersion }}"
RECORD_REPLAY_API_KEY: ${{ secrets.RECORD_REPLAY_API_KEY }}
if: ${{ github.repository == 'newfold-labs/wp-plugin-web' && env.RECORD_REPLAY_API_KEY != '' }}
with:
api-key: ${{ secrets.RECORD_REPLAY_API_KEY }}
browser: 'replay-chromium'
command: npm run test:e2e -- --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --tag web,php-${{ matrix.phpVersion }},wp-${{ matrix.wpVersion }}
upload-all: false

- name: List Replays
if: always()
shell: bash
run: npx @replayio/replay ls --json

- name: Store screenshots of test failures
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: screenshots
path: ./tests/cypress/screenshots

- name: Output debug.log file contents
if: ${{ always() }}
continue-on-error: true
run: npx wp-env run wordpress "cat /var/www/html/wp-content/debug.log"
21 changes: 20 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,26 @@ jobs:
run: npx @wordpress/env@latest start

- name: Run Cypress Tests
run: npm run test:e2e
env:
RECORD_REPLAY_API_KEY: ${{ secrets.RECORD_REPLAY_API_KEY }}
if: ${{ github.repository != 'newfold-labs/wp-plugin-web' || env.RECORD_REPLAY_API_KEY == '' }}
run: npx cypress run

- name: Run Cypress Tests
uses: replayio/action-cypress@v0.2.8
env:
RECORD_REPLAY_API_KEY: ${{ secrets.RECORD_REPLAY_API_KEY }}
if: ${{ github.repository == 'newfold-labs/wp-plugin-web' && env.RECORD_REPLAY_API_KEY != '' }}
with:
api-key: ${{ secrets.RECORD_REPLAY_API_KEY }}
browser: 'replay-chromium'
command: npm run test:e2e -- --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --tag web
upload-all: false

- name: List Replays
if: always()
shell: bash
run: npx @replayio/replay ls --json

- name: Store screenshots of test failures
if: ${{ failure() }}
Expand Down
6 changes: 3 additions & 3 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "WordPress/WordPress#tags/6.1.1",
"core": "WordPress/WordPress#tags/6.2.2",
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
Expand All @@ -15,11 +15,11 @@
"env": {
"tests": {
"config": {
"WP_SITEURL": "localhost:8887",
"WP_TESTS_DOMAIN": "localhost:8887",
"WP_TESTS_EMAIL": "evanrm@gmail.com",
"WP_TESTS_TITLE": "Web WordPress Plugin",
"WP_TESTS_BINARY": "php"
}
}
}
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"newfold-labs/wp-module-notifications": "^1.1.2",
"newfold-labs/wp-module-performance": "^1.0.1",
"newfold-labs/wp-module-secure-passwords": "^1.1",
"newfold-labs/wp-module-sso": "^1.0.3",
"newfold-labs/wp-module-sso": "^1.0.4",
"wp-forge/wp-update-handler": "^1.0",
"wp-forge/wp-upgrade-handler": "^1.0"
}
Expand Down
99 changes: 19 additions & 80 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7234de6

Please sign in to comment.