Skip to content

Commit ce8849e

Browse files
committed
chore(github): extract matrix from workflows
1 parent 5e5ca19 commit ce8849e

4 files changed

Lines changed: 29 additions & 45 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build matrix
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
build_matrix:
7+
description: JSON array of build configurations from matrix.json
8+
value: ${{ jobs.build-matrix.outputs.build_matrix }}
9+
10+
jobs:
11+
build-matrix:
12+
name: Build matrix
13+
runs-on: ubuntu-latest
14+
outputs:
15+
build_matrix: ${{ steps.set-matrix.outputs.build_matrix }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
sparse-checkout: |
21+
.github/workflows/matrix.json
22+
sparse-checkout-cone-mode: false
23+
- id: set-matrix
24+
shell: bash
25+
run: |
26+
echo "build_matrix=$( cat .github/workflows/matrix.json | jq --monochrome-output --compact-output )" >> $GITHUB_OUTPUT

.github/workflows/ci.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,7 @@ on:
1212

1313
jobs:
1414
build-matrix:
15-
name: Build matrix
16-
runs-on: ubuntu-latest
17-
outputs:
18-
build_matrix: ${{ steps.set-matrix.outputs.build_matrix }}
19-
steps:
20-
- name: Checkout
21-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22-
with:
23-
sparse-checkout: |
24-
.github/workflows/matrix.json
25-
sparse-checkout-cone-mode: false
26-
- id: set-matrix
27-
shell: bash
28-
run: |
29-
echo "build_matrix=$( cat .github/workflows/matrix.json | jq --monochrome-output --compact-output )" >> $GITHUB_OUTPUT
15+
uses: ./.github/workflows/_build-matrix.yaml
3016

3117
lint-and-test:
3218
name: Lint and test (${{ matrix.build.NAME }})

.github/workflows/release.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,7 @@ permissions:
1010

1111
jobs:
1212
build-matrix:
13-
name: Build matrix
14-
runs-on: ubuntu-latest
15-
outputs:
16-
build_matrix: ${{ steps.set-matrix.outputs.build_matrix }}
17-
steps:
18-
- name: Checkout
19-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20-
with:
21-
sparse-checkout: |
22-
.github/workflows/matrix.json
23-
sparse-checkout-cone-mode: false
24-
- id: set-matrix
25-
shell: bash
26-
run: |
27-
echo "build_matrix=$( cat .github/workflows/matrix.json | jq --monochrome-output --compact-output )" >> $GITHUB_OUTPUT
13+
uses: ./.github/workflows/_build-matrix.yaml
2814

2915
publish-npm-binaries:
3016
name: Publish npm binaries

.github/workflows/test-release.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,7 @@ on:
77

88
jobs:
99
build-matrix:
10-
name: Build matrix
11-
runs-on: ubuntu-latest
12-
outputs:
13-
build_matrix: ${{ steps.set-matrix.outputs.build_matrix }}
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17-
with:
18-
sparse-checkout: |
19-
.github/workflows/matrix.json
20-
sparse-checkout-cone-mode: false
21-
- id: set-matrix
22-
shell: bash
23-
run: |
24-
echo "build_matrix=$( cat .github/workflows/matrix.json | jq --monochrome-output --compact-output )" >> $GITHUB_OUTPUT
10+
uses: ./.github/workflows/_build-matrix.yaml
2511

2612
publish-npm-binaries:
2713
name: (Test) Publish npm binaries

0 commit comments

Comments
 (0)