Fix index.json #84
Workflow file for this run
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: Check generated files | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
check_generated: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
# Some mapfiles are generated by scripts, but also committed to the repo. | |
# Check for mismatches between committed files and script output. | |
- name: Regenerate mapfiles and check for equality | |
run: | | |
for script in gen_*.py; do | |
mapfile=$(echo $script | sed 's/^gen_//; s/\.py$//').map | |
if [ ! -f "$mapfile" ]; then | |
mapfile="private/$mapfile" | |
if [ ! -f "$mapfile" ]; then | |
echo "Result of ${script} not committed" | |
exit 1 | |
fi | |
fi | |
python3 "$script" | cmp - "$mapfile" | |
done | |
# This one is not committed, but generated by the Docker entrypoint. | |
# It should at least be valid JSON. | |
- name: Check index.json file | |
run: | | |
# Create some bogus connection files, or including them will fail: | |
mkdir -p connections | |
for c in bag basiskaart dataselectie dataservices milieu monumenten nap panorama various_small_datasets; do | |
echo CONNECTIONTYPE postgis > connection/$c.inc | |
done | |
python3 tools/make_indexjson.py *.map | jq . |