Skip to content

Commit 486748d

Browse files
committed
build(compat): Run patch freshness check in parallel to testing chores
1 parent ec9161e commit 486748d

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

.github/actions/prepare/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@ inputs:
77
description: 'The version of Node.js to use'
88
required: false
99
default: '22'
10+
use-volta:
11+
description: 'Whether to use Volta for managing Node.js versions'
12+
required: false
13+
default: 'false'
1014

1115
runs:
1216
using: composite
1317
steps:
1418
- uses: actions/setup-node@v4
1519
with:
1620
node-version: ${{ inputs.node-version }}
21+
if: ${{ inputs.use-volta == 'false' }}
22+
- uses: volta-cli/action@v1
23+
with:
24+
node-version: ${{ inputs.node-version }}
25+
if: ${{ inputs.use-volta == 'true' }}
1726

1827
#region Build the standard bundle
1928
- uses: actions/cache@v4

.github/workflows/integration-workflow.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,6 @@ jobs:
4848
env:
4949
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
5050

51-
- name: 'Check that the patch files are consistent with fresh builds'
52-
run: |
53-
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/plugin-compat/sources/patches packages/plugin-compat/extra/ | wc -l) -gt 0 ]]; then
54-
for generator in packages/plugin-compat/extra/*/gen-*-patch.ts; do
55-
yarn node -r @yarnpkg/monorepo/scripts/setup-ts-execution $generator '*';
56-
done
57-
[[ $(git diff --name-only packages/plugin-compat/sources/patches "packages/plugin-compat/extra/*/patches/*" | tee /dev/stderr | wc -l) -eq 0 ]]
58-
fi
59-
shell: bash
60-
if: |
61-
(success() || failure()) && github.event.pull_request != ''
62-
env:
63-
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
64-
6551
- name: 'Check that libzip artifacts are consistent with a fresh build (fix w/ "git merge master && bash packages/yarnpkg-libzip/artifacts/build.sh")'
6652
run: |
6753
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/yarnpkg-libzip/artifacts' 'packages/yarnpkg-libzip/sources/*.js' | wc -l) -gt 0 ]]; then

.github/workflows/plugin-compat-workflow.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,33 @@ jobs:
2424
- name: 'Run the plugin-compat tests'
2525
run: |
2626
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+
35+
- uses: ./.github/actions/prepare
36+
with:
37+
use-volta: 'true'
38+
39+
- run: |
40+
PKGS=$(ls -d packages/plugin-compat/extra)
41+
if ! git diff --quiet "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/plugin-compat/extra/*'; then
42+
for pkg in $PKGS; do
43+
yarn "build:patch:$pkg"
44+
done
45+
else
46+
for pkg in $PKGS; do
47+
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
48+
yarn "build:patch:$pkg"
49+
fi
50+
done
51+
fi
52+
shell: bash
53+
if: |
54+
(success() || failure()) && github.event.pull_request != ''
55+
env:
56+
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}

0 commit comments

Comments
 (0)