qa: Enforce JSON lint for GCT configs #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: config-json-lint | |
on: [push, pull_request] | |
jobs: | |
lint: | |
name: JSON format check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
file: ["config_example.json", "testdata/configtest.json"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install jq | |
run: sudo apt-get install jq | |
- name: Check JSON format for ${{ matrix.file }} | |
run: | | |
jq '.exchanges |= sort_by(.name)' --indent 1 ${{ matrix.file }} > processed_${{ matrix.file }} | |
if ! diff ${{ matrix.file }} processed_${{ matrix.file }}; then | |
echo "Differences found in ${{ matrix.file }}! Please run 'make lint_configs'" | |
exit 1 | |
fi |