Skip to content

Commit

Permalink
Merge pull request #149 from t-hamano/enhancement/update-github-action
Browse files Browse the repository at this point in the history
Update the target WordPress version of GitHub actions
  • Loading branch information
t-hamano authored Nov 2, 2022
2 parents f0cb476 + ddd3d39 commit 097ee1c
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 33 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/run-test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.3', '7.4', '8.0' ]
wp-versions: [ 'WordPress#5.9.4', 'WordPress#6.0.3' ]
# wp-versions: [ 'WordPress#5.9.4', 'WordPress#6.0.3', 'WordPress' ]
php-versions: [
'7.3',
'7.4',
'8.0'
]
wp-versions: [
'WordPress#5.9.4',
'WordPress#6.0.3',
'WordPress#6.1',
'WordPress'
]
name: PHP ${{ matrix.php-versions }} / ${{ matrix.wp-versions }} Test

steps:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.3', '7.4', '8.0' ]
wp-versions: [ 'WordPress#5.9.4', 'WordPress#6.0.3' ]
# wp-versions: [ 'WordPress#5.9.4', 'WordPress#6.0.3', 'WordPress' ]
php-versions: [
'7.3',
'7.4',
'8.0'
]
wp-versions: [
'WordPress#5.9.4',
'WordPress#6.0.3',
'WordPress#6.1',
'WordPress'
]
name: PHP ${{ matrix.php-versions }} / ${{ matrix.wp-versions }} Test

steps:
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"@wordpress/e2e-test-utils": "^8.3.0",
"@wordpress/env": "^5.4.0",
"@wordpress/env": "^5.5.0",
"@wordpress/jest-preset-default": "^10.0.0",
"@wordpress/jest-puppeteer-axe": "^5.2.0",
"@wordpress/scripts": "^24.3.0",
Expand Down
19 changes: 10 additions & 9 deletions test/e2e/specs/block-support.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe( 'Block Support', () => {
await createNewFlexibleTableBlock();
await openSidebar();

if ( wpVersion === '6-1' ) {
if ( [ '6-1', '6-2' ].includes( wpVersion ) ) {
await toggleToolsPanelMenu();
for ( let i = 0; i < 6; i++ ) {
const selector = 'div[aria-label="Typography options"] button.components-menu-item__button';
Expand All @@ -51,7 +51,7 @@ describe( 'Block Support', () => {
}
}

const fontFamilyLabel = wpVersion === '6-1' ? 'Font' : 'Font family';
const fontFamilyLabel = [ '6-1', '6-2' ].includes( wpVersion ) ? 'Font' : 'Font family';
await selectOptionFromLabel( fontFamilyLabel, '"Source Serif Pro", serif' );
await clickButtonWithAriaLabel( '.components-font-size-picker', 'Large' );
await clickButtonWithAriaLabel( '.typography-block-support-panel', 'Appearance' );
Expand All @@ -64,20 +64,19 @@ describe( 'Block Support', () => {
await inputValueFromLabel( 'Line height', '3' );
await clickButtonWithAriaLabel( '.typography-block-support-panel', 'Lowercase' );

if ( wpVersion === '6-1' ) {
if ( [ '6-1', '6-2' ].includes( wpVersion ) ) {
await inputValueFromLabel( 'Letter spacing', '10' );
} else {
await page.focus( 'input[aria-label="Letter-spacing"], input[aria-label="Letter spacing"]' );
await page.keyboard.type( '10' );
}

// WordPress 6.1 has a different inline style order generated by block support
const snapShot =
wpVersion === '6-1'
? `<!-- wp:flexible-table-block/table {"style":{"typography":{"fontStyle":"normal","fontWeight":"500","lineHeight":"3","textTransform":"lowercase","letterSpacing":"10px"}},"fontSize":"large","fontFamily":"source-serif-pro"} -->
const snapShot = [ '6-1', '6-2' ].includes( wpVersion )
? `<!-- wp:flexible-table-block/table {"style":{"typography":{"fontStyle":"normal","fontWeight":"500","lineHeight":"3","textTransform":"lowercase","letterSpacing":"10px"}},"fontSize":"large","fontFamily":"source-serif-pro"} -->
<figure class="wp-block-flexible-table-block-table has-source-serif-pro-font-family has-large-font-size" style="font-style:normal;font-weight:500;letter-spacing:10px;line-height:3;text-transform:lowercase"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:flexible-table-block/table -->`
: `<!-- wp:flexible-table-block/table {"style":{"typography":{"fontStyle":"normal","fontWeight":"500","lineHeight":"3","textTransform":"lowercase","letterSpacing":"10px"}},"fontSize":"large","fontFamily":"source-serif-pro"} -->
: `<!-- wp:flexible-table-block/table {"style":{"typography":{"fontStyle":"normal","fontWeight":"500","lineHeight":"3","textTransform":"lowercase","letterSpacing":"10px"}},"fontSize":"large","fontFamily":"source-serif-pro"} -->
<figure class="wp-block-flexible-table-block-table has-source-serif-pro-font-family has-large-font-size" style="font-style:normal;font-weight:500;line-height:3;text-transform:lowercase;letter-spacing:10px"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:flexible-table-block/table -->`;

Expand All @@ -91,10 +90,12 @@ describe( 'Block Support', () => {
await openSidebar();
await toggleToolsPanelMenu( 'dimensions' );
await page.click( `button[aria-label="Show Margin"]` );
const unlinkSidesLabel = wpVersion === '6-1' ? 'Unlink sides' : 'Unlink Sides';
const unlinkSidesLabel = [ '6-1', '6-2' ].includes( wpVersion )
? 'Unlink sides'
: 'Unlink Sides';
await clickButtonWithAriaLabel( '.dimensions-block-support-panel', unlinkSidesLabel );

if ( wpVersion === '6-1' ) {
if ( [ '6-1', '6-2' ].includes( wpVersion ) ) {
for ( let i = 0; i < 4; i++ ) {
await clickButtonWithAriaLabel( '.dimensions-block-support-panel', 'Set custom size' );
}
Expand Down
22 changes: 12 additions & 10 deletions test/e2e/specs/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ describe( 'Transform from core table block to flexible table block', () => {
const wpVersion = await getWpVersion();
await createNewCoreTableBlock();
await openSidebar();
const sidebarPanelTitle = wpVersion === '6-1' ? 'Settings' : 'Table settings';
const sidebarPanelTitle = [ '6-1', '6-2' ].includes( wpVersion )
? 'Settings'
: 'Table settings';
await openSidebarPanelWithTitle( sidebarPanelTitle );
await clickToggleControlWithText( 'Header section' );
await clickToggleControlWithText( 'Footer section' );
Expand All @@ -61,7 +63,9 @@ describe( 'Transform from core table block to flexible table block', () => {
const wpVersion = await getWpVersion();
await createNewCoreTableBlock( { col: 6, row: 6 } );
await openSidebar();
const sidebarPanelTitle = wpVersion === '6-1' ? 'Settings' : 'Table settings';
const sidebarPanelTitle = [ '6-1', '6-2' ].includes( wpVersion )
? 'Settings'
: 'Table settings';
await openSidebarPanelWithTitle( sidebarPanelTitle );
await clickToggleControlWithText( 'Fixed width table cells' );
await transformBlockTo( 'Flexible Table' );
Expand Down Expand Up @@ -213,12 +217,11 @@ describe( 'Transform from flexible table block to core table block', () => {
await transformBlockTo( 'Table' );

// Figcaption has `.wp-element-caption` class in WordPress 6.1
const snapShot =
wpVersion === '6-1'
? `<!-- wp:table {"hasFixedLayout":true} -->
const snapShot = [ '6-1', '6-2' ].includes( wpVersion )
? `<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption class="wp-element-caption">Flexible<br>Table<br>Block</figcaption></figure>
<!-- /wp:table -->`
: `<!-- wp:table {"hasFixedLayout":true} -->
: `<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption>Flexible<br>Table<br>Block</figcaption></figure>
<!-- /wp:table -->`;

Expand All @@ -239,12 +242,11 @@ describe( 'Transform from flexible table block to core table block', () => {
await transformBlockTo( 'Table' );

// Figcaption has `.wp-element-caption` class in WordPress 6.1
const snapShot =
wpVersion === '6-1'
? `<!-- wp:table {"hasFixedLayout":true} -->
const snapShot = [ '6-1', '6-2' ].includes( wpVersion )
? `<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption class="wp-element-caption">Flexible Table Block</figcaption></figure>
<!-- /wp:table -->`
: `<!-- wp:table {"hasFixedLayout":true} -->
: `<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption>Flexible Table Block</figcaption></figure>
<!-- /wp:table -->`;

Expand Down

0 comments on commit 097ee1c

Please sign in to comment.