Skip to content

Commit

Permalink
Merge pull request #309 from KevinBatdorf/fix-6-5-compat
Browse files Browse the repository at this point in the history
Add 6-5 compat updates
  • Loading branch information
KevinBatdorf authored Apr 4, 2024
2 parents ae69ee5 + f1e1aed commit 28f5dc7
Show file tree
Hide file tree
Showing 12 changed files with 3,834 additions and 24,791 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-production-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: npm install and build
run: |
npm ci
Expand All @@ -21,7 +21,7 @@ jobs:
CI: true

- name: Package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-block-pro
retention-days: 5
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/cypress-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
spec: ${{ steps.list_files.outputs.spec }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: List Files
id: list_files
run: |
Expand All @@ -29,9 +29,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
Expand All @@ -54,11 +54,11 @@ jobs:
wp-version: [null, 'Next']
steps:
- name: Clone repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3
- name: Node modules cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
Expand All @@ -79,7 +79,7 @@ jobs:
if: ${{ matrix.wp-version }}
run: rm .wp-env.json
- name: Maybe change WP version
uses: jsdaniell/[email protected].1
uses: jsdaniell/[email protected].3
if: ${{ matrix.wp-version }}
with:
name: '.wp-env.json'
Expand All @@ -89,17 +89,17 @@ jobs:
npx wp-env start
echo "WordPress version: `npx wp-env run cli core version`"
- name: Cypress run
uses: cypress-io/github-action@v5
uses: cypress-io/github-action@v6
with:
spec: cypress/e2e/${{ matrix.spec }}.cy.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cypress-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
spec: ${{ steps.list_files.outputs.spec }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: List Files
id: list_files
run: |
Expand All @@ -25,9 +25,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
Expand All @@ -49,9 +49,9 @@ jobs:
spec: ${{ fromJson(needs.generate_file_list.outputs.spec) }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Restore node modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -65,17 +65,17 @@ jobs:
npx wp-env start
echo "WordPress version: `npx wp-env run cli core version`"
- name: Cypress run
uses: cypress-io/github-action@v5
uses: cypress-io/github-action@v6
with:
spec: cypress/e2e/${{ matrix.spec }}.cy.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-to-wp-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: npm install and build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-wordpress-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Push to WordPress.org
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: npm install and build
run: |
npm ci
Expand Down
5 changes: 1 addition & 4 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"core": null,
"plugins": ["."],
"mappings": {
"wp-content/plugins/prismatic": "https://downloads.wordpress.org/plugin/prismatic.zip"
}
"plugins": ["."]
}
1 change: 1 addition & 0 deletions cypress/e2e/compatability.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ context('Compatability checks', () => {
cy.installPlugin('prismatic');
// make sure we don't see thhe word fatal or error
cy.get('body').should('not.contain', 'fatal error');
cy.visitAdminPage('plugins.php');
// make sure both prismatic and code-block-pro are active
cy.get('#deactivate-code-block-pro').should('exist');
cy.get('#deactivate-prismatic').should('exist');
Expand Down
13 changes: 10 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ Cypress.Commands.add('getPostContent', (addon = '') => {
return cy.get(`${BLOCK_CONTAINER} ${addon}`);
});
Cypress.Commands.add('focusBlock', (blockName, addon = '') => {
cy.get(
`${BLOCK_CONTAINER} .wp-block[class$="${blockName}"] ${addon}`,
).click();
cy.window().then((win) => {
cy.get(`${BLOCK_CONTAINER} .wp-block[class$="${blockName}"] ${addon}`)
.should('be.visible')
.then((el) => {
el[0].focus();
win.scrollTo(0, 0);
// make sure the window is scrolled to the top
return win.scrollY === 0;
});
});
});
Cypress.Commands.add('getCurrentPostObject', () => {
cy.wpDataSelect('core/editor', 'getCurrentPost');
Expand Down
Loading

0 comments on commit 28f5dc7

Please sign in to comment.