Skip to content

Commit fb82997

Browse files
authored
Merge pull request #224 from alleyinteractive/feature/issue-184/convert-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)
2 parents f42d9d6 + c212123 commit fb82997

File tree

10 files changed

+33118
-17469
lines changed

10 files changed

+33118
-17469
lines changed

.github/workflows/all-pr-tests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "All Pull Request Tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
9+
jobs:
10+
# We use a single job to ensure that all steps run in the same environment and
11+
# reduce the number of minutes used.
12+
pr-tests:
13+
# Don't run on draft PRs
14+
if: github.event.pull_request.draft == false
15+
# Timeout after 10 minutes
16+
timeout-minutes: 10
17+
# Define a matrix of PHP/WordPress versions to test against
18+
strategy:
19+
matrix:
20+
php: [8.2, 8.3]
21+
wordpress: ["latest"]
22+
runs-on: ubuntu-latest
23+
# Cancel any existing runs of this workflow
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}
26+
cancel-in-progress: true
27+
# Name the job in the matrix
28+
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }}"
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Run General Tests
33+
# See https://github.com/alleyinteractive/action-test-general for more options
34+
uses: alleyinteractive/action-test-general@develop
35+
36+
- name: Run Node Tests
37+
# See https://github.com/alleyinteractive/action-test-node for more options.
38+
# Defaults to the latest LTS version.
39+
uses: alleyinteractive/action-test-node@develop
40+
41+
- name: Run PHP Tests
42+
# See https://github.com/alleyinteractive/action-test-php for more options
43+
uses: alleyinteractive/action-test-php@develop
44+
with:
45+
php-version: '${{ matrix.php }}'
46+
wordpress-version: '${{ matrix.wordpress }}'
47+
skip-wordpress-install: 'true'
48+
# This required job ensures that all PR checks have passed before merging.
49+
all-pr-checks-passed:
50+
name: All PR checks passed
51+
needs:
52+
- pr-tests
53+
runs-on: ubuntu-latest
54+
if: always()
55+
steps:
56+
- name: Check job statuses
57+
run: |
58+
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
59+
echo "One or more jobs failed"
60+
exit 1
61+
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
62+
echo "One or more jobs were cancelled"
63+
exit 1
64+
else
65+
echo "All jobs passed or were skipped"
66+
exit 0
67+
fi

.github/workflows/code-quality.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/coding-standards.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/node-tests.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/unit-test.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

blocks/email-settings/edit.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export default function Edit() {
9292
newBlocks = [...parsedContentFromTemplate];
9393
}
9494

95+
// @ts-expect-error
9596
dispatch('core/block-editor').resetBlocks(newBlocks);
9697
};
9798

blocks/section/edit.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,15 @@ export default function Edit({
9696
const handleSelect = (posts: number[]) => {
9797
postBlocks.forEach((id: string) => {
9898
const postId = posts.shift();
99+
// @ts-expect-error
99100
dispatch('core/block-editor').updateBlockAttributes(id, { postId });
100101
});
101102
};
102103

103104
useEffect(() => {
104105
if (showNumbers) {
105106
postBlocks.forEach((id: string, index: number) => {
107+
// @ts-expect-error
106108
dispatch('core/block-editor').updateBlockAttributes(id, { number: index + 1 });
107109
});
108110
}
@@ -122,18 +124,16 @@ export default function Edit({
122124
<InnerBlocks />
123125
</div>
124126
<InspectorControls>
125-
{ /* @ts-ignore */}
126127
<PanelBody
127128
title={__('Post Selection', 'wp-newsletter-builder')}
128129
initialOpen
129130
>
130-
{ /* @ts-ignore */}
131131
<PanelRow>
132132
<MultiplePostPicker
133133
onUpdate={handleSelect}
134134
allowedTypes={allowedPostTypes}
135135
params={{ after: cutoff.toISOString(), per_page: 20 }}
136-
// @ts-ignore
136+
// @ts-expect-error
137137
searchRender={PostPickerResult}
138138
/>
139139
</PanelRow>

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
"phpstan": "phpstan --memory-limit=1024M",
6060
"test": [
6161
"@phpcs",
62-
"@phpunit",
63-
"@phpstan"
62+
"@phpunit"
6463
]
6564
}
6665
}

0 commit comments

Comments
 (0)