-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.74 KB
/
TestExamples.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
52
53
54
name: TestExamples
on:
push:
branches:
- main
- develop
workflow_dispatch:
env:
WORKING_DIR: ./examples/
MAPPING_URL: 'https://github.com/Mat-O-Lab/MapToMethod/raw/main/examples/example-map.yaml'
PARSER_PORT: 3001
APP_PORT: 5003
MAPPER_PORT: 4000
CONVERTER_PORT: 6000
SSL_VERIFY: False
jobs:
TestExamples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: run app
run: |
docker-compose -f docker-compose.develop.yml up -d
sleep 20
docker ps -a
- name: parse mapping to YARRRML parser
working-directory: ${{env.WORKING_DIR}}
continue-on-error: true
run: |
curl -X POST "http://localhost:${{env.APP_PORT}}/api/yarrrmltorml" -H "accept: text/turtle" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"mapping_url\":\"${{env.MAPPING_URL}}\"}" > example.rml
- name: print logs
if: always()
run: |
docker-compose logs
- name: join the method and the data meta graph
working-directory: ${{env.WORKING_DIR}}
run: |
RESULT="$(curl -X POST "http://localhost:${{env.APP_PORT}}/api/createrdf" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"mapping_url\":\"${{env.MAPPING_URL}}\"}")"
DATA="$(jq .graph <<< "$RESULT")"
#remove quots
echo -e "${DATA:1:-1}" > example.rdf
#unescape quots
sed -i 's/\\"/'\"'/g' example.rdf
- name: Commit files # commit the output folder
uses: EndBug/add-and-commit@v9
with:
message: 'updated example output'
add: '*.* --force'
cwd: './examples/'