-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.42 KB
/
test_api.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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()