Skip to content

Commit

Permalink
Merge pull request #224 from alleyinteractive/feature/issue-184/conve…
Browse files Browse the repository at this point in the history
…rt-to-alley-build

Issue-184: Convert the build system to use `alley-build` instead of `wp-scripts build` (feature/issue-182/trim-unused-wordpress-dependencies)
  • Loading branch information
mogmarsh authored Jan 13, 2025
2 parents f42d9d6 + c212123 commit fb82997
Show file tree
Hide file tree
Showing 10 changed files with 33,118 additions and 17,469 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/all-pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "All Pull Request Tests"

on:
pull_request:
branches:
- develop
types: [opened, synchronize, reopened, ready_for_review]

jobs:
# We use a single job to ensure that all steps run in the same environment and
# reduce the number of minutes used.
pr-tests:
# Don't run on draft PRs
if: github.event.pull_request.draft == false
# Timeout after 10 minutes
timeout-minutes: 10
# Define a matrix of PHP/WordPress versions to test against
strategy:
matrix:
php: [8.2, 8.3]
wordpress: ["latest"]
runs-on: ubuntu-latest
# Cancel any existing runs of this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}
cancel-in-progress: true
# Name the job in the matrix
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }}"
steps:
- uses: actions/checkout@v4

- name: Run General Tests
# See https://github.com/alleyinteractive/action-test-general for more options
uses: alleyinteractive/action-test-general@develop

- name: Run Node Tests
# See https://github.com/alleyinteractive/action-test-node for more options.
# Defaults to the latest LTS version.
uses: alleyinteractive/action-test-node@develop

- name: Run PHP Tests
# See https://github.com/alleyinteractive/action-test-php for more options
uses: alleyinteractive/action-test-php@develop
with:
php-version: '${{ matrix.php }}'
wordpress-version: '${{ matrix.wordpress }}'
skip-wordpress-install: 'true'
# This required job ensures that all PR checks have passed before merging.
all-pr-checks-passed:
name: All PR checks passed
needs:
- pr-tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Check job statuses
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more jobs failed"
exit 1
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs were cancelled"
exit 1
else
echo "All jobs passed or were skipped"
exit 0
fi
12 changes: 0 additions & 12 deletions .github/workflows/code-quality.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/coding-standards.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/node-tests.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/unit-test.yml

This file was deleted.

1 change: 1 addition & 0 deletions blocks/email-settings/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default function Edit() {
newBlocks = [...parsedContentFromTemplate];
}

// @ts-expect-error
dispatch('core/block-editor').resetBlocks(newBlocks);
};

Expand Down
6 changes: 3 additions & 3 deletions blocks/section/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ export default function Edit({
const handleSelect = (posts: number[]) => {
postBlocks.forEach((id: string) => {
const postId = posts.shift();
// @ts-expect-error
dispatch('core/block-editor').updateBlockAttributes(id, { postId });
});
};

useEffect(() => {
if (showNumbers) {
postBlocks.forEach((id: string, index: number) => {
// @ts-expect-error
dispatch('core/block-editor').updateBlockAttributes(id, { number: index + 1 });
});
}
Expand All @@ -122,18 +124,16 @@ export default function Edit({
<InnerBlocks />
</div>
<InspectorControls>
{ /* @ts-ignore */}
<PanelBody
title={__('Post Selection', 'wp-newsletter-builder')}
initialOpen
>
{ /* @ts-ignore */}
<PanelRow>
<MultiplePostPicker
onUpdate={handleSelect}
allowedTypes={allowedPostTypes}
params={{ after: cutoff.toISOString(), per_page: 20 }}
// @ts-ignore
// @ts-expect-error
searchRender={PostPickerResult}
/>
</PanelRow>
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
"phpstan": "phpstan --memory-limit=1024M",
"test": [
"@phpcs",
"@phpunit",
"@phpstan"
"@phpunit"
]
}
}
Loading

0 comments on commit fb82997

Please sign in to comment.