Skip to content

Commit 2f751d1

Browse files
authored
Fix matrix exclude keys in build-dummy-app-webpack-test-bundles job (#2036)
## Summary Fixes the GitHub Actions error where matrix exclude keys didn't match any keys within the matrix for the `build-dummy-app-webpack-test-bundles` job. ## Changes - Added missing `exclude` section to `build-dummy-app-webpack-test-bundles` job in `.github/workflows/integration-tests.yml` - The exclude section matches the structure used in `dummy-app-integration-tests` job - This ensures the minimum dependency matrix (Ruby 3.2, Node 20) only runs on master, workflow_dispatch, force_run, or when full-ci label is present ## Test Plan - ✅ Verified workflow syntax with actionlint - ✅ Checked that the exclude section matches the pattern used in dummy-app-integration-tests job - CI will validate the matrix configuration works correctly ## Related - Follows the pattern established in PR #2034 ## Summary by CodeRabbit * **Chores** * Refined GitHub Actions workflow configuration to optimize test matrix execution conditions across integration and webpack test bundles.
1 parent 37f5894 commit 2f751d1

File tree

3 files changed

+66
-51
lines changed

3 files changed

+66
-51
lines changed

.github/workflows/examples.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,34 @@ jobs:
5757
script/ci-changes-detector "$BASE_REF"
5858
shell: bash
5959

60-
examples:
60+
setup-matrix:
6161
needs: detect-changes
62+
runs-on: ubuntu-22.04
63+
outputs:
64+
matrix: ${{ steps.set-matrix.outputs.matrix }}
65+
steps:
66+
- id: set-matrix
67+
run: |
68+
# Determine if we should run full matrix (master, workflow_dispatch, force_run, or full-ci label)
69+
if [[ "${{ github.ref }}" == "refs/heads/master" ]] || \
70+
[[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \
71+
[[ "${{ inputs.force_run }}" == "true" ]] || \
72+
[[ "${{ needs.detect-changes.outputs.has_full_ci_label }}" == "true" ]]; then
73+
# Full matrix: test both latest and minimum supported versions
74+
echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"},{"ruby-version":"3.2","dependency-level":"minimum"}]}' >> $GITHUB_OUTPUT
75+
else
76+
# PR matrix: test only latest versions for fast feedback
77+
echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"}]}' >> $GITHUB_OUTPUT
78+
fi
79+
80+
examples:
81+
needs: [detect-changes, setup-matrix]
6282
# Run on master, workflow_dispatch, OR when generators needed
6383
if: |
6484
github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_generators == 'true'
6585
strategy:
6686
fail-fast: false
67-
matrix:
68-
include:
69-
# Always run: Latest versions (fast feedback on PRs)
70-
- ruby-version: '3.4'
71-
dependency-level: 'latest'
72-
# Master and workflow_dispatch: Minimum supported versions (full coverage)
73-
- ruby-version: '3.2'
74-
dependency-level: 'minimum'
75-
exclude:
76-
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
77-
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
78-
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
87+
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
7988
env:
8089
SKIP_YARN_COREPACK_CHECK: 0
8190
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}

.github/workflows/gem-tests.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,32 @@ jobs:
6161
script/ci-changes-detector "$BASE_REF"
6262
shell: bash
6363

64-
rspec-package-tests:
64+
setup-gem-tests-matrix:
6565
needs: detect-changes
66+
runs-on: ubuntu-22.04
67+
outputs:
68+
matrix: ${{ steps.set-matrix.outputs.matrix }}
69+
steps:
70+
- id: set-matrix
71+
run: |
72+
# Determine if we should run full matrix (master or full-ci label)
73+
if [[ "${{ github.ref }}" == "refs/heads/master" ]] || \
74+
[[ "${{ needs.detect-changes.outputs.has_full_ci_label }}" == "true" ]]; then
75+
# Full matrix: test both latest and minimum supported versions
76+
echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"},{"ruby-version":"3.2","dependency-level":"minimum"}]}' >> $GITHUB_OUTPUT
77+
else
78+
# PR matrix: test only latest versions for fast feedback
79+
echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"}]}' >> $GITHUB_OUTPUT
80+
fi
81+
82+
rspec-package-tests:
83+
needs: [detect-changes, setup-gem-tests-matrix]
6684
# Run on master OR when Ruby tests needed on PR
6785
if: |
6886
(github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_ruby_tests == 'true')
6987
strategy:
7088
fail-fast: false
71-
matrix:
72-
include:
73-
# Always run: Latest versions (fast feedback on PRs)
74-
- ruby-version: '3.4'
75-
dependency-level: 'latest'
76-
# Master and full-ci label: Minimum supported versions (full coverage)
77-
- ruby-version: '3.2'
78-
dependency-level: 'minimum'
79-
exclude:
80-
# Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label)
81-
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
82-
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
89+
matrix: ${{ fromJson(needs.setup-gem-tests-matrix.outputs.matrix) }}
8390
env:
8491
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
8592
runs-on: ubuntu-22.04

.github/workflows/integration-tests.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,33 @@ jobs:
5858
fi
5959
shell: bash
6060

61-
build-dummy-app-webpack-test-bundles:
61+
setup-integration-matrix:
6262
needs: detect-changes
63+
runs-on: ubuntu-22.04
64+
outputs:
65+
matrix: ${{ steps.set-matrix.outputs.matrix }}
66+
steps:
67+
- id: set-matrix
68+
run: |
69+
# Determine if we should run full matrix (master, workflow_dispatch, force_run, or full-ci label)
70+
if [[ "${{ github.ref }}" == "refs/heads/master" ]] || \
71+
[[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \
72+
[[ "${{ inputs.force_run }}" == "true" ]] || \
73+
[[ "${{ needs.detect-changes.outputs.has_full_ci_label }}" == "true" ]]; then
74+
# Full matrix: test both latest and minimum supported versions
75+
echo 'matrix={"include":[{"ruby-version":"3.4","node-version":"22","dependency-level":"latest"},{"ruby-version":"3.2","node-version":"20","dependency-level":"minimum"}]}' >> $GITHUB_OUTPUT
76+
else
77+
# PR matrix: test only latest versions for fast feedback
78+
echo 'matrix={"include":[{"ruby-version":"3.4","node-version":"22","dependency-level":"latest"}]}' >> $GITHUB_OUTPUT
79+
fi
80+
81+
build-dummy-app-webpack-test-bundles:
82+
needs: [detect-changes, setup-integration-matrix]
6383
# Run on master, workflow_dispatch, OR when tests needed on PR
6484
if: |
6585
github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
6686
strategy:
67-
matrix:
68-
ruby-version: ['3.4']
69-
node-version: ['22']
70-
dependency-level: ['latest']
71-
include:
72-
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
73-
- ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}}
74-
node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}}
75-
dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}}
87+
matrix: ${{ fromJson(needs.setup-integration-matrix.outputs.matrix) }}
7688
runs-on: ubuntu-22.04
7789
steps:
7890
- uses: actions/checkout@v4
@@ -142,25 +154,12 @@ jobs:
142154
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
143155

144156
dummy-app-integration-tests:
145-
needs: [detect-changes, build-dummy-app-webpack-test-bundles]
157+
needs: [detect-changes, setup-integration-matrix, build-dummy-app-webpack-test-bundles]
146158
# Run on master, workflow_dispatch, OR when tests needed on PR
147159
if: |
148160
github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
149161
strategy:
150-
matrix:
151-
ruby-version: ['3.4']
152-
node-version: ['22']
153-
dependency-level: ['latest']
154-
include:
155-
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
156-
- ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}}
157-
node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}}
158-
dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}}
159-
exclude:
160-
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
161-
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
162-
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }}
163-
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
162+
matrix: ${{ fromJson(needs.setup-integration-matrix.outputs.matrix) }}
164163
runs-on: ubuntu-22.04
165164
steps:
166165
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)