Skip to content

Commit 096d37f

Browse files
committed
fmt(ci): consistently use fromJSON instead of fromJson in github actions
1 parent 785b7ea commit 096d37f

9 files changed

+30
-30
lines changed

.github/workflows/_build-and-test-locally.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ env:
3939

4040
jobs:
4141
build-neon:
42-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
42+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
4343
permissions:
4444
id-token: write # aws-actions/configure-aws-credentials
4545
contents: read
@@ -318,7 +318,7 @@ jobs:
318318
contents: read
319319
statuses: write
320320
needs: [ build-neon ]
321-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
321+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
322322
container:
323323
image: ${{ inputs.build-tools-image }}
324324
credentials:

.github/workflows/_check-codestyle-rust.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
check-codestyle-rust:
2424
strategy:
2525
matrix:
26-
arch: ${{ fromJson(inputs.archs) }}
27-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
26+
arch: ${{ fromJSON(inputs.archs) }}
27+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
2828

2929
permissions:
3030
packages: read

.github/workflows/_meta.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
121121
- name: Get the release PR run ID
122122
id: release-pr-run-id
123-
if: ${{ contains(fromJson('["storage-release", "compute-release", "proxy-release"]'), steps.run-kind.outputs.run-kind) }}
123+
if: ${{ contains(fromJSON('["storage-release", "compute-release", "proxy-release"]'), steps.run-kind.outputs.run-kind) }}
124124
env:
125125
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126126
CURRENT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

.github/workflows/benchmarking.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ jobs:
441441

442442
strategy:
443443
fail-fast: false
444-
matrix: ${{fromJson(needs.generate-matrices.outputs.pgbench-compare-matrix)}}
444+
matrix: ${{fromJSON(needs.generate-matrices.outputs.pgbench-compare-matrix)}}
445445

446446
env:
447447
TEST_PG_BENCH_DURATIONS_MATRIX: "60m"
@@ -483,7 +483,7 @@ jobs:
483483
aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
484484

485485
- name: Create Neon Project
486-
if: contains(fromJson('["neonvm-captest-new", "neonvm-captest-new-many-tables", "neonvm-captest-freetier", "neonvm-azure-captest-freetier", "neonvm-azure-captest-new"]'), matrix.platform)
486+
if: contains(fromJSON('["neonvm-captest-new", "neonvm-captest-new-many-tables", "neonvm-captest-freetier", "neonvm-azure-captest-freetier", "neonvm-azure-captest-new"]'), matrix.platform)
487487
id: create-neon-project
488488
uses: ./.github/actions/neon-project-create
489489
with:
@@ -523,7 +523,7 @@ jobs:
523523
# without (neonvm-captest-new)
524524
# and with (neonvm-captest-new-many-tables) many relations in the database
525525
- name: Create many relations before the run
526-
if: contains(fromJson('["neonvm-captest-new-many-tables"]'), matrix.platform)
526+
if: contains(fromJSON('["neonvm-captest-new-many-tables"]'), matrix.platform)
527527
uses: ./.github/actions/run-python-test-set
528528
with:
529529
build_type: ${{ env.BUILD_TYPE }}
@@ -753,7 +753,7 @@ jobs:
753753

754754
strategy:
755755
fail-fast: false
756-
matrix: ${{ fromJson(needs.generate-matrices.outputs.olap-compare-matrix) }}
756+
matrix: ${{ fromJSON(needs.generate-matrices.outputs.olap-compare-matrix) }}
757757

758758
env:
759759
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
@@ -880,7 +880,7 @@ jobs:
880880

881881
strategy:
882882
fail-fast: false
883-
matrix: ${{ fromJson(needs.generate-matrices.outputs.tpch-compare-matrix) }}
883+
matrix: ${{ fromJSON(needs.generate-matrices.outputs.tpch-compare-matrix) }}
884884

885885
env:
886886
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
@@ -999,7 +999,7 @@ jobs:
999999

10001000
strategy:
10011001
fail-fast: false
1002-
matrix: ${{ fromJson(needs.generate-matrices.outputs.olap-compare-matrix) }}
1002+
matrix: ${{ fromJSON(needs.generate-matrices.outputs.olap-compare-matrix) }}
10031003

10041004
env:
10051005
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install

.github/workflows/build-build-tools-image.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ jobs:
7979
env:
8080
IMAGE_TAG: ${{ steps.set-variables.outputs.image-tag }}
8181
EVERYTHING: |
82-
${{ contains(fromJson(steps.set-variables.outputs.archs), 'x64') &&
83-
contains(fromJson(steps.set-variables.outputs.archs), 'arm64') &&
84-
contains(fromJson(steps.set-variables.outputs.debians), 'bullseye') &&
85-
contains(fromJson(steps.set-variables.outputs.debians), 'bookworm') }}
82+
${{ contains(fromJSON(steps.set-variables.outputs.archs), 'x64') &&
83+
contains(fromJSON(steps.set-variables.outputs.archs), 'arm64') &&
84+
contains(fromJSON(steps.set-variables.outputs.debians), 'bullseye') &&
85+
contains(fromJSON(steps.set-variables.outputs.debians), 'bookworm') }}
8686
run: |
8787
if docker manifest inspect ghcr.io/neondatabase/build-tools:${IMAGE_TAG}; then
8888
found=true
@@ -99,13 +99,13 @@ jobs:
9999

100100
strategy:
101101
matrix:
102-
arch: ${{ fromJson(needs.check-image.outputs.archs) }}
103-
debian: ${{ fromJson(needs.check-image.outputs.debians) }}
102+
arch: ${{ fromJSON(needs.check-image.outputs.archs) }}
103+
debian: ${{ fromJSON(needs.check-image.outputs.debians) }}
104104

105105
permissions:
106106
packages: write
107107

108-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
108+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
109109

110110
steps:
111111
- uses: actions/checkout@v4
@@ -168,8 +168,8 @@ jobs:
168168
- name: Create multi-arch image
169169
env:
170170
DEFAULT_DEBIAN_VERSION: bookworm
171-
ARCHS: ${{ join(fromJson(needs.check-image.outputs.archs), ' ') }}
172-
DEBIANS: ${{ join(fromJson(needs.check-image.outputs.debians), ' ') }}
171+
ARCHS: ${{ join(fromJSON(needs.check-image.outputs.archs), ' ') }}
172+
DEBIANS: ${{ join(fromJSON(needs.check-image.outputs.debians), ' ') }}
173173
EVERYTHING: ${{ needs.check-image.outputs.everything }}
174174
IMAGE_TAG: ${{ needs.check-image.outputs.tag }}
175175
run: |

.github/workflows/build-macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: macos-15
4141
strategy:
4242
matrix:
43-
postgres-version: ${{ inputs.rebuild_everything && fromJson('["v14", "v15", "v16", "v17"]') || fromJSON(inputs.pg_versions) }}
43+
postgres-version: ${{ inputs.rebuild_everything && fromJSON('["v14", "v15", "v16", "v17"]') || fromJSON(inputs.pg_versions) }}
4444
env:
4545
# Use release build only, to have less debug info around
4646
# Hence keeping target/ (and general cache size) smaller

.github/workflows/build_and_test.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
matrix:
185185
arch: [ x64, arm64 ]
186186
# Do not build or run tests in debug for release branches
187-
build-type: ${{ fromJson((startsWith(github.ref_name, 'release') && github.event_name == 'push') && '["release"]' || '["debug", "release"]') }}
187+
build-type: ${{ fromJSON((startsWith(github.ref_name, 'release') && github.event_name == 'push') && '["release"]' || '["debug", "release"]') }}
188188
include:
189189
- build-type: release
190190
arch: arm64
@@ -504,7 +504,7 @@ jobs:
504504
matrix:
505505
arch: [ x64, arm64 ]
506506

507-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
507+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
508508

509509
permissions:
510510
packages: write
@@ -606,7 +606,7 @@ jobs:
606606
debian: bookworm
607607
arch: [ x64, arm64 ]
608608

609-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
609+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
610610

611611
steps:
612612
- uses: actions/checkout@v4
@@ -727,7 +727,7 @@ jobs:
727727
vm-compute-node-image-arch:
728728
needs: [ check-permissions, meta, compute-node-image ]
729729
if: ${{ contains(fromJSON('["push-main", "pr", "compute-rc-pr"]'), needs.meta.outputs.run-kind) }}
730-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
730+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
731731
permissions:
732732
contents: read
733733
packages: write
@@ -827,7 +827,7 @@ jobs:
827827
permissions:
828828
packages: read
829829

830-
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
830+
runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
831831

832832
steps:
833833
- uses: actions/checkout@v4
@@ -941,7 +941,7 @@ jobs:
941941
env:
942942
SOURCE_TAG: >-
943943
${{
944-
contains(fromJson('["storage-release", "compute-release", "proxy-release"]'), needs.meta.outputs.run-kind)
944+
contains(fromJSON('["storage-release", "compute-release", "proxy-release"]'), needs.meta.outputs.run-kind)
945945
&& needs.meta.outputs.release-pr-run-id
946946
|| needs.meta.outputs.build-tag
947947
}}

.github/workflows/neon_extra_builds.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171
uses: ./.github/workflows/build-macos.yml
7272
with:
7373
pg_versions: ${{ needs.files-changed.outputs.postgres_changes }}
74-
rebuild_rust_code: ${{ fromJson(needs.files-changed.outputs.rebuild_rust_code) }}
75-
rebuild_everything: ${{ fromJson(needs.files-changed.outputs.rebuild_everything) }}
74+
rebuild_rust_code: ${{ fromJSON(needs.files-changed.outputs.rebuild_rust_code) }}
75+
rebuild_everything: ${{ fromJSON(needs.files-changed.outputs.rebuild_everything) }}
7676

7777
gather-rust-build-stats:
7878
needs: [ check-permissions, build-build-tools-image, files-changed ]

.github/workflows/pre-merge-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
${{
160160
always()
161161
&& github.event_name == 'merge_group'
162-
&& contains(fromJson('["release", "release-proxy", "release-compute"]'), needs.meta.outputs.branch)
162+
&& contains(fromJSON('["release", "release-proxy", "release-compute"]'), needs.meta.outputs.branch)
163163
}}
164164
env:
165165
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)