diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index b1f9765a3..b30f2dae3 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -1,16 +1,16 @@ name: stac-fastapi on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: test: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9', '3.10'] + python-version: ["3.8", "3.9", "3.10"] timeout-minutes: 10 services: @@ -118,9 +118,56 @@ jobs: POSTGRES_HOST_READER: localhost POSTGRES_HOST_WRITER: localhost POSTGRES_PORT: 5432 + + validate: + runs-on: ubuntu-latest + services: + pgstac: + image: ghcr.io/stac-utils/pgstac:v0.6.11 + env: + POSTGRES_USER: username + POSTGRES_PASSWORD: password + POSTGRES_DB: postgis + PGUSER: username + PGPASSWORD: password + PGDATABASE: postgis + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: stac_fastapi/pgstac/setup.cfg + - name: Install stac-fastapi and stac-api-validator + run: pip install ./stac_fastapi/pgstac[server] stac-api-validator + - name: Load data and validate + run: python -m stac_fastapi.pgstac.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && stac-api-validator --root-url http://localhost:8080 --conformance core + env: + POSTGRES_USER: username + POSTGRES_PASS: password + POSTGRES_DBNAME: postgis + POSTGRES_HOST_READER: localhost + POSTGRES_HOST_WRITER: localhost + POSTGRES_PORT: 5432 + PGUSER: username + PGPASSWORD: password + PGHOST: localhost + PGDATABASE: postgis + APP_HOST: 0.0.0.0 + APP_PORT: 8080 + test-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Test generating docs - run: make docs \ No newline at end of file + run: make docs