Skip to content

Commit 239048a

Browse files
committed
try processing the conditional logic in another job
1 parent b34c1de commit 239048a

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

.github/workflows/examples.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }}
3131
run_generators: ${{ steps.detect.outputs.run_generators }}
3232
has_full_ci_label: ${{ steps.check-label.outputs.result }}
33+
matrix_array: ${{ steps.determine-matrix.outputs.result }}
3334
steps:
3435
- uses: actions/checkout@v4
3536
with:
@@ -39,6 +40,14 @@ jobs:
3940
- name: Check for full-ci label
4041
id: check-label
4142
uses: ./.github/actions/check-full-ci-label
43+
- name: Determine matrix strategy
44+
id: determine-matrix
45+
run: |
46+
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then
47+
echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT"
48+
else
49+
echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT"
50+
fi
4251
- name: Detect relevant changes
4352
id: detect
4453
run: |
@@ -65,7 +74,7 @@ jobs:
6574
strategy:
6675
fail-fast: false
6776
matrix:
68-
dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }}
77+
dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }}
6978
env:
7079
SKIP_YARN_COREPACK_CHECK: 0
7180
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}

.github/workflows/gem-tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }}
3535
run_generators: ${{ steps.detect.outputs.run_generators }}
3636
has_full_ci_label: ${{ steps.check-label.outputs.result }}
37+
matrix_array: ${{ steps.determine-matrix.outputs.result }}
3738
steps:
3839
- uses: actions/checkout@v4
3940
with:
@@ -43,6 +44,14 @@ jobs:
4344
- name: Check for full-ci label
4445
id: check-label
4546
uses: ./.github/actions/check-full-ci-label
47+
- name: Determine matrix strategy
48+
id: determine-matrix
49+
run: |
50+
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then
51+
echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT"
52+
else
53+
echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT"
54+
fi
4655
- name: Detect relevant changes
4756
id: detect
4857
run: |
@@ -69,7 +78,7 @@ jobs:
6978
strategy:
7079
fail-fast: false
7180
matrix:
72-
dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }}
81+
dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }}
7382
env:
7483
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
7584
runs-on: ubuntu-22.04

.github/workflows/integration-tests.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }}
3333
run_generators: ${{ steps.detect.outputs.run_generators }}
3434
has_full_ci_label: ${{ steps.check-label.outputs.result }}
35+
matrix_array: ${{ steps.determine-matrix.outputs.result }}
3536
steps:
3637
- uses: actions/checkout@v4
3738
with:
@@ -41,6 +42,14 @@ jobs:
4142
- name: Check for full-ci label
4243
id: check-label
4344
uses: ./.github/actions/check-full-ci-label
45+
- name: Determine matrix strategy
46+
id: determine-matrix
47+
run: |
48+
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then
49+
echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT"
50+
else
51+
echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT"
52+
fi
4453
- name: Detect relevant changes
4554
id: detect
4655
run: |
@@ -66,7 +75,7 @@ jobs:
6675
strategy:
6776
fail-fast: false
6877
matrix:
69-
dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }}
78+
dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }}
7079
runs-on: ubuntu-22.04
7180
steps:
7281
- name: Translate matrix for Ruby and Node versions
@@ -153,7 +162,7 @@ jobs:
153162
strategy:
154163
fail-fast: false
155164
matrix:
156-
dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }}
165+
dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }}
157166
runs-on: ubuntu-22.04
158167
steps:
159168
- name: Translate matrix for Ruby and Node versions

.github/workflows/package-js-tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }}
3737
run_generators: ${{ steps.detect.outputs.run_generators }}
3838
has_full_ci_label: ${{ steps.check-label.outputs.result }}
39+
matrix_array: ${{ steps.determine-matrix.outputs.result }}
3940
steps:
4041
- uses: actions/checkout@v4
4142
with:
@@ -45,6 +46,14 @@ jobs:
4546
- name: Check for full-ci label
4647
id: check-label
4748
uses: ./.github/actions/check-full-ci-label
49+
- name: Determine matrix strategy
50+
id: determine-matrix
51+
run: |
52+
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then
53+
echo 'result=["22"]' | jq -c . >> "$GITHUB_OUTPUT"
54+
else
55+
echo 'result=["22","20"]' | jq -c . >> "$GITHUB_OUTPUT"
56+
fi
4857
- name: Detect relevant changes
4958
id: detect
5059
run: |
@@ -71,7 +80,7 @@ jobs:
7180
strategy:
7281
fail-fast: false
7382
matrix:
74-
node-version: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['20']) || toJSON(['22', '20'])) }}
83+
node-version: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }}
7584
runs-on: ubuntu-22.04
7685
steps:
7786
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)