Skip to content

ci: add test_api job #11

ci: add test_api job

ci: add test_api job #11

Workflow file for this run

name: Test API
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
COMPOSE_FILE: compose.yml:compose.dev.yml
FORCE_COLOR: 1
jobs:
test_api:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: docker --version
- name: Start the docker-compose stack
run: docker compose up --detach --wait api fuseki metrics
- name: Test if /info returns a response
run: curl --verbose http://localhost:8080/exist/restxq/v1/info
- name: Add test corpus
run: |
curl \
--request POST \
--url http://localhost:8080/exist/restxq/v1/corpora \
--user admin: \
--header 'Content-Type: application/json' \
--data '{"name": "test", "title": "Test Drama Corpus", "repository": "https://github.com/dracor-org/testdracor"}'
- name: Load data for test corpus
run: |
curl \
--request POST \
--url http://localhost:8080/exist/restxq/v1/corpora/test \
--user admin: \
--header 'Content-Type: application/json' \
--data '{"load": true}'
- name: Test if corpus returns a response
run: curl --verbose http://localhost:8080/exist/restxq/v1/corpora/test
# TODO: run schemathesis
- name: Stop the docker-compose stack
run: docker compose down
if: always()