Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stac-api-validator #148

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@ name: Planetary Computer APIs PR CI

on:
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run cibuild
run: ./scripts/cibuild

validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10" # stac-api-validator requires >= 3.10
cache: "pip"
- name: Validate
run: ./scripts/validate
30 changes: 30 additions & 0 deletions scripts/validate
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e

if [[ "${CI}" ]]; then
set -x
fi

function usage() {
echo -n \
"Usage: $(basename "$0") [url]
Run stac-api-validator on the local server
"
}

geometry='{"type":"Polygon","coordinates":[[[-85.3125,30.9375],[-85.3125,31],[-85.375,31],[-85.375,30.9375],[-85.3125,30.9375]]]}'

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
scripts/setup
which stac-api-validator >/dev/null || pip install stac-api-validator==0.4.1
stac-api-validator --root-url http://localhost:8080/stac/ \
--conformance collections \
--conformance core \
--collection naip \
--geometry "$geometry"

# Currently broken:
# - `--conformance features`: needs https://github.com/stac-utils/stac-fastapi/pull/508
# - `--conformance item-search`: needs https://github.com/stac-utils/stac-api-validator/pull/237 and *not* stac-api-validate v0.4.2 (https://github.com/stac-utils/stac-api-validator/issues/240)
fi