qa: Enforce JSON lint for GCT configs #2
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: configs-json-lint | |
on: [push, pull_request] | |
jobs: | |
lint: | |
name: JSON format check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install jq | |
run: sudo apt-get install jq | |
- name: Check config_example.json format | |
run: | | |
jq '.exchanges |= sort_by(.name)' --indent 1 config_example.json > processed_config_example.json | |
if ! diff config_example.json processed_config_example.json; then | |
echo "jq differences found in config_example.json! Please run 'make lint_configs'" | |
exit 1 | |
else | |
rm processed_config_example.json | |
fi | |
- name: Check testdata/configtest.json format | |
run: | | |
jq '.exchanges |= sort_by(.name)' --indent 1 testdata/configtest.json > testdata/processed_configtest.json | |
if ! diff testdata/configtest.json testdata/processed_configtest.json; then | |
echo "jq differences found in testdata/configtest.json! Please run 'make lint_configs'" | |
exit 1 | |
else | |
rm testdata/processed_configtest.json | |
fi | |