You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run patch freshness check outside of Testing Chores so as not to block
other checks. Also, improve the logic to only check the patches that
would be affected by the PR changes.
Copy file name to clipboardExpand all lines: .github/workflows/plugin-compat-workflow.yml
+42Lines changed: 42 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -24,3 +24,45 @@ jobs:
24
24
- name: 'Run the plugin-compat tests'
25
25
run: |
26
26
node ./scripts/run-yarn.js test:plugin-compat
27
+
28
+
check-patches:
29
+
name: 'Check that the patch files are consistent with fresh builds'
30
+
runs-on: ubuntu-latest
31
+
32
+
steps:
33
+
- uses: actions/checkout@v4
34
+
- run: |
35
+
git fetch --no-tags --unshallow origin HEAD master
36
+
37
+
- uses: ./.github/actions/prepare
38
+
39
+
- name: 'Regenerate affected patches'
40
+
run: |
41
+
PKGS=$(basename -a packages/plugin-compat/extra/*/)
42
+
if ! git diff --quiet "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/plugin-compat/extra' ':!packages/plugin-compat/extra/*/*'; then
43
+
# If a file outside of the package-specific folders changed, rebuild all patches
44
+
for pkg in $PKGS; do
45
+
echo "::group::Regenerating $pkg patch"
46
+
yarn "build:patch:$pkg" '*'
47
+
echo "::endgroup::"
48
+
done
49
+
else
50
+
# Otherwise, only rebuild the patches that have changed
51
+
for pkg in $PKGS; do
52
+
if ! git diff --quiet "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- "packages/plugin-compat/sources/patches/$pkg.patch.ts" "packages/plugin-compat/extra/$pkg/"; then
53
+
echo "::group::Regenerating $pkg patch"
54
+
yarn "build:patch:$pkg" '*'
55
+
echo "::endgroup::"
56
+
fi
57
+
done
58
+
fi
59
+
if ! git diff --quiet -- 'packages/plugin-compat/extra/*/patches/*' 'packages/plugin-compat/sources/patches/'; then
60
+
echo ''
61
+
echo "Files would be changed by fresh builds:"
62
+
git diff --name-only -- 'packages/plugin-compat/extra/*/patches/*' 'packages/plugin-compat/sources/patches/' | sed 's/^/- /'
0 commit comments