Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cypress e2e tests #43

Open
wants to merge 11 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.yml]
[*.{yml,json,ymal}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
end_of_line = crlf
56 changes: 56 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: E2E Testing

on:
push:
branches:
- stable
- develop
pull_request:
branches:
- stable
- develop

jobs:
cypress:
name: ${{ matrix.core.name }} / ${{ matrix.php.name }}
## Pending upgrade of `@wordpress/env` package.
continue-on-error: ${{ matrix.core.version == 'WordPress/WordPress#master' }}
runs-on: ubuntu-latest
strategy:
matrix:
php:
- {name: 'PHP Default', version: null}
core:
- {name: 'WP stable', version: 'latest'}
- {name: 'WP 5.9', version: 'WordPress/WordPress#5.9'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
include:
- php: {name: 'PHP 8.1', version: '8.1'}
core: {name: 'WP 5.9', version: 'WordPress/WordPress#5.9'}
- php: {name: 'PHP 8.3', version: '8.3'}
core: {name: 'WP stable', version: 'latest'}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm install

- name: Composer
run: composer install
continue-on-error: true

- name: Set the core version
run: |
./tests/bin/set-core-version.js ${{ matrix.core.version }} ${{ matrix.php.version }}

- name: Set up WP environment
run: npm run env:start

- name: Log WP environment versions
run: |
npx wp-env run cli "wp core version"
npx wp-env run cli "php --version"

- name: Test
run: npm run cypress:run
19 changes: 11 additions & 8 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true
},
"phpVersion": "8.3",
"plugins": [
"."
]
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true
},
"phpVersion": "8.3",
"plugins": [
"."
],
"mappings": {
"wp-cli.yml": "./tests/bin/wp-cli.yml"
}
}
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "joshuadavidnelson/archived-post-status",
"version": "0.3.11",
"type": "wordpress-plugin",
"description": "A WordPress plugin that allows posts and pages to be archived so you can unpublish content without having to trash it.",
"homepage": "https://archivedpoststat.us/",
Expand All @@ -9,6 +8,11 @@
{
"name": "joshuadavidnelson",
"email": "[email protected]"
},
{
"name": "frankiejarrett",
"email": "[email protected]",
"homepage": "https://frankie.bio/"
}
],
"require": {
Expand Down
Loading
Loading